[MLton-commit] r6561

Matthew Fluet fluet at mlton.org
Mon Apr 7 11:55:42 PDT 2008


Report before and after sizes on stack grow and shrink.

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

U   mlton/trunk/runtime/gc/forward.c
U   mlton/trunk/runtime/gc/garbage-collection.c

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

Modified: mlton/trunk/runtime/gc/forward.c
===================================================================
--- mlton/trunk/runtime/gc/forward.c	2008-04-07 18:55:38 UTC (rev 6560)
+++ mlton/trunk/runtime/gc/forward.c	2008-04-07 18:55:41 UTC (rev 6561)
@@ -96,10 +96,11 @@
       assert (getStackCurrentObjptr(s) == op
               or reservedNew <= stack->reserved);
       if (reservedNew < stack->reserved) {
+        if (DEBUG_STACKS or s->controls.messages)
+          fprintf (stderr, "[GC: Shrinking stack of size %s bytes to size %s bytes.]\n",
+                   uintmaxToCommaString(stack->reserved),
+                   uintmaxToCommaString(reservedNew));
         stack->reserved = reservedNew;
-        if (DEBUG_STACKS or s->controls.messages)
-          fprintf (stderr, "[GC: Shrinking stack to size %s bytes.]\n",
-                   uintmaxToCommaString(stack->reserved));
       }
       objectBytes = sizeof (struct GC_stack) + stack->used;
       skip = stack->reserved - stack->used;

Modified: mlton/trunk/runtime/gc/garbage-collection.c
===================================================================
--- mlton/trunk/runtime/gc/garbage-collection.c	2008-04-07 18:55:38 UTC (rev 6560)
+++ mlton/trunk/runtime/gc/garbage-collection.c	2008-04-07 18:55:41 UTC (rev 6561)
@@ -54,7 +54,8 @@
   size = sizeofStackGrow (s, getStackCurrent(s));
   if (DEBUG_STACKS or s->controls.messages)
     fprintf (stderr, 
-             "[GC: Growing stack to size %s bytes.]\n",
+             "[GC: Growing stack of size %s bytes to size %s bytes.]\n",
+             uintmaxToCommaString(getStackCurrent(s)->reserved),
              uintmaxToCommaString(alignStackReserved (s, size)));
   assert (hasHeapBytesFree (s, sizeofStackWithHeaderAligned (s, size), 0));
   stack = newStack (s, size, TRUE);




More information about the MLton-commit mailing list