[MLton-commit] r4498
Stephen Weeks
MLton@mlton.org
Mon, 8 May 2006 19:41:51 -0700
Moved GC_mmapAnon_safe, which is defined in a platform-independent
manner (although it calls a platform-dependent function).
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/virtual-memory.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/use-mmap.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/virtual-memory.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/virtual-memory.c 2006-05-09 02:40:31 UTC (rev 4497)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/virtual-memory.c 2006-05-09 02:41:50 UTC (rev 4498)
@@ -6,6 +6,17 @@
* See the file MLton-LICENSE for details.
*/
+void *GC_mmapAnon_safe (void *p, size_t length) {
+ void *result;
+
+ result = GC_mmapAnon (p, length);
+ if ((void*)-1 == result) {
+ GC_displayMem ();
+ die ("Out of memory.");
+ }
+ return result;
+}
+
static inline void GC_memcpy (pointer src, pointer dst, size_t size) {
if (DEBUG_DETAILED)
fprintf (stderr, "GC_memcpy ("FMTPTR", "FMTPTR", %zu)\n",
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/use-mmap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/use-mmap.c 2006-05-09 02:40:31 UTC (rev 4497)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/use-mmap.c 2006-05-09 02:41:50 UTC (rev 4498)
@@ -11,14 +11,3 @@
void *GC_mmapAnon (void *start, size_t length) {
return mmapAnon (start, length);
}
-
-void *GC_mmapAnon_safe (void *p, size_t length) {
- void *result;
-
- result = GC_mmapAnon (p, length);
- if ((void*)-1 == result) {
- GC_displayMem ();
- die ("Out of memory.");
- }
- return result;
-}