[MLton-commit] r7056

Matthew Fluet fluet at mlton.org
Wed Apr 8 05:31:48 PDT 2009


Attempting to allocate more than the virtual address space is destined to fail.
----------------------------------------------------------------------

U   mlton/trunk/runtime/gc/heap.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/gc/heap.c
===================================================================
--- mlton/trunk/runtime/gc/heap.c	2009-04-08 12:31:44 UTC (rev 7055)
+++ mlton/trunk/runtime/gc/heap.c	2009-04-08 12:31:47 UTC (rev 7056)
@@ -422,7 +422,8 @@
     shrinkHeap (s, curHeapp, liveSize);
   initHeap (s, newHeapp);
   /* Allocate a space of the desired size. */
-  if (createHeap (s, newHeapp, desiredSize, minSize)) {
+  if (minSize + sizeofCardMapAndCrossMap (s, minSize) <= SIZE_MAX - curHeapp->withMapsSize
+      and createHeap (s, newHeapp, desiredSize, minSize)) {
     pointer from;
     pointer to;
     size_t remaining;




More information about the MLton-commit mailing list