[MLton-commit] r6572

Matthew Fluet fluet at mlton.org
Mon Apr 7 11:56:10 PDT 2008


Rename 'active' to 'current'

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

U   mlton/trunk/runtime/gc/forward.c
U   mlton/trunk/runtime/gc/mark-compact.c
U   mlton/trunk/runtime/gc/stack.c

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

Modified: mlton/trunk/runtime/gc/forward.c
===================================================================
--- mlton/trunk/runtime/gc/forward.c	2008-04-07 18:56:08 UTC (rev 6571)
+++ mlton/trunk/runtime/gc/forward.c	2008-04-07 18:56:10 UTC (rev 6572)
@@ -60,16 +60,16 @@
                                          bytesNonObjptrs, numObjptrs);
       skip = 0;
     } else { /* Stack. */
-      bool active;
+      bool current;
       size_t reservedNew;
       GC_stack stack;
 
       assert (STACK_TAG == tag);
       headerBytes = GC_STACK_HEADER_SIZE;
       stack = (GC_stack)p;
-      active = getStackCurrent(s) == stack;
+      current = getStackCurrent(s) == stack;
 
-      reservedNew = sizeofStackShrink (s, stack, active);
+      reservedNew = sizeofStackShrink (s, stack, current);
       if (reservedNew < stack->reserved) {
         if (DEBUG_STACKS or s->controls.messages)
           fprintf (stderr,

Modified: mlton/trunk/runtime/gc/mark-compact.c
===================================================================
--- mlton/trunk/runtime/gc/mark-compact.c	2008-04-07 18:56:08 UTC (rev 6571)
+++ mlton/trunk/runtime/gc/mark-compact.c	2008-04-07 18:56:10 UTC (rev 6572)
@@ -142,17 +142,17 @@
         skipFront = 0;
         skipGap = 0;
       } else { /* Stack. */
-        bool active;
+        bool current;
         size_t reservedNew, reservedOld;
         GC_stack stack;
 
         assert (STACK_TAG == tag);
         headerBytes = GC_STACK_HEADER_SIZE;
         stack = (GC_stack)p;
-        active = currentStack == stack;
+        current = currentStack == stack;
 
         reservedOld = stack->reserved;
-        reservedNew = sizeofStackShrink (s, stack, active);
+        reservedNew = sizeofStackShrink (s, stack, current);
         objectBytes = sizeof (struct GC_stack) + stack->used;
         skipFront = reservedOld - stack->used;
         skipGap = reservedOld - reservedNew;
@@ -278,17 +278,17 @@
         skipFront = 0;
         skipGap = 0;
       } else { /* Stack. */
-        bool active;
+        bool current;
         size_t reservedNew, reservedOld;
         GC_stack stack;
 
         assert (STACK_TAG == tag);
         headerBytes = GC_STACK_HEADER_SIZE;
         stack = (GC_stack)p;
-        active = currentStack == stack;
+        current = currentStack == stack;
 
         reservedOld = stack->reserved;
-        reservedNew = sizeofStackShrink (s, stack, active);
+        reservedNew = sizeofStackShrink (s, stack, current);
         if (reservedNew < stack->reserved) {
           if (DEBUG_STACKS or s->controls.messages)
             fprintf (stderr,

Modified: mlton/trunk/runtime/gc/stack.c
===================================================================
--- mlton/trunk/runtime/gc/stack.c	2008-04-07 18:56:08 UTC (rev 6571)
+++ mlton/trunk/runtime/gc/stack.c	2008-04-07 18:56:10 UTC (rev 6572)
@@ -159,11 +159,11 @@
   return res;
 }
 
-size_t sizeofStackShrink (GC_state s, GC_stack stack, bool active) {
+size_t sizeofStackShrink (GC_state s, GC_stack stack, bool current) {
       size_t reservedMax, reservedShrink, reservedMin, reservedNew;
 
-      if (active) {
-        /* Shrink active stacks. */
+      if (current) {
+        /* Shrink current stacks. */
         reservedMax =
           (size_t)(s->controls.ratios.stackCurrentMaxReserved * stack->used);
         size_t reservedPermit =
@@ -185,12 +185,12 @@
         alignStackReserved
         (s, max(min(reservedMax,reservedShrink),reservedMin));
       /* It's possible that reservedNew > stack->reserved for the
-       * active stack if the stack invariant is violated.  In that
+       * current stack if the stack invariant is violated.  In that
        * case, we want to leave the stack alone, because some other
        * part of the gc will grow the stack.  We cannot do any growing
        * here because we may run out of to space.
        */
-      assert (active or reservedNew <= stack->reserved);
+      assert (current or reservedNew <= stack->reserved);
       reservedNew = min (stack->reserved, reservedNew);
       return reservedNew;
 }




More information about the MLton-commit mailing list