[MLton-commit] r4119

Matthew Fluet MLton@mlton.org
Sat, 22 Oct 2005 07:08:23 -0700


Forwarding pointer sizes in arrays
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c

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

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.c	2005-10-22 02:32:10 UTC (rev 4118)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.c	2005-10-22 14:08:21 UTC (rev 4119)
@@ -33,9 +33,9 @@
     die ("Out of memory: cannot allocate array with %"PRIuMAX" bytes.",
          /*ullongToCommaString*/(arraySizeMax));
   arraySize = (size_t)arraySizeMax;
-  if (arraySize < GC_ARRAY_HEADER_SIZE + WORD_SIZE)
+  if (arraySize < GC_ARRAY_HEADER_SIZE + OBJPTR_SIZE)
     /* Create space for forwarding pointer. */
-    arraySize = GC_ARRAY_HEADER_SIZE + WORD_SIZE;
+    arraySize = GC_ARRAY_HEADER_SIZE + OBJPTR_SIZE;
   if (DEBUG_ARRAY)
     fprintf (stderr, "array with "FMTARRLEN" elts of size %zu and total size %zu.  Ensure %zu bytes free.\n",
              numElements, bytesPerElement, 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c	2005-10-22 02:32:10 UTC (rev 4118)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c	2005-10-22 14:08:21 UTC (rev 4119)
@@ -365,7 +365,7 @@
   nurserySize = h->size - h->oldGenSize - oldGenBytesRequested;
   s->limitPlusSlop = h->start + h->size;
   s->limit = s->limitPlusSlop - LIMIT_SLOP;
-  assert (isAligned (nurserySize, WORD_SIZE)); // FIXME
+  assert (isAligned (nurserySize, POINTER_SIZE));
   if (/* The mutator marks cards. */
       s->mutatorMarksCards
       /* There is enough space in the nursery. */
@@ -393,7 +393,7 @@
        )) {
     s->canMinor = TRUE;
     nurserySize /= 2;
-    while (not (isAligned (nurserySize, WORD_SIZE))) {
+    while (not (isAligned (nurserySize, POINTER_SIZE))) {
       nurserySize -= 2;
     }
     clearCardMap (s);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c	2005-10-22 02:32:10 UTC (rev 4118)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c	2005-10-22 14:08:21 UTC (rev 4119)
@@ -97,7 +97,7 @@
     s->lastMajorStatistics.bytesLive +=
       align (GC_ARRAY_HEADER_SIZE
              + ((0 == numBytes)
-                ? WORD_SIZE
+                ? OBJPTR_SIZE
                 : numBytes),
              s->alignment);
   }