[MLton-commit] r6562

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


Report used bytes 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:41 UTC (rev 6561)
+++ mlton/trunk/runtime/gc/forward.c	2008-04-07 18:55:43 UTC (rev 6562)
@@ -97,9 +97,11 @@
               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",
+          fprintf (stderr,
+                   "[GC: Shrinking stack of size %s bytes to size %s bytes, using %s bytes.]\n",
                    uintmaxToCommaString(stack->reserved),
-                   uintmaxToCommaString(reservedNew));
+                   uintmaxToCommaString(reservedNew),
+                   uintmaxToCommaString(stack->used));
         stack->reserved = reservedNew;
       }
       objectBytes = sizeof (struct GC_stack) + stack->used;

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




More information about the MLton-commit mailing list