[MLton-commit] r5418

Matthew Fluet fluet at mlton.org
Sun Mar 11 09:07:57 PST 2007


Fix alignment of nursery for -align 8 on 32-bit platforms
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c

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

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c	2007-03-11 16:52:53 UTC (rev 5417)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c	2007-03-11 17:07:56 UTC (rev 5418)
@@ -57,7 +57,7 @@
              uintmaxToCommaString(nurseryBytesRequested));
   h = &s->heap;
   assert (isFrontierAligned (s, h->start + h->oldGenSize + oldGenBytesRequested));
-  nurserySize = h->size - h->oldGenSize - oldGenBytesRequested;
+  nurserySize = h->size - align(h->oldGenSize + oldGenBytesRequested, s->alignment);
   s->limitPlusSlop = h->start + h->size;
   s->limit = s->limitPlusSlop - GC_HEAP_LIMIT_SLOP;
   assert (isAligned (nurserySize, s->alignment));
@@ -67,7 +67,8 @@
       and (nurseryBytesRequested
            <= (size_t)(s->limitPlusSlop
                        - alignFrontier (s, (s->limitPlusSlop 
-                                            - nurserySize / 2 + 2))))
+                                            - nurserySize / 2
+                                            - s->alignment / 2))))
       /* The nursery is large enough to be worth it. */
       and (((float)(h->size - s->lastMajorStatistics.bytesLive) 
             / (float)nurserySize) 




More information about the MLton-commit mailing list