[MLton-commit] r7228

Matthew Fluet fluet at mlton.org
Wed Sep 16 05:57:25 PDT 2009


Unconditionally setCardMapAndCrossMap at then end of a major gc to
clear the card map and cross map (which are invalidated by the major
gc).  GC_pack invokes performGC without allowing a resize, so the card
map and cross map could be invalid after a GC_pack, leading to
bugs/assertions on subsequent minor gcs.
----------------------------------------------------------------------

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

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

Modified: mlton/trunk/runtime/gc/garbage-collection.c
===================================================================
--- mlton/trunk/runtime/gc/garbage-collection.c	2009-09-16 01:18:27 UTC (rev 7227)
+++ mlton/trunk/runtime/gc/garbage-collection.c	2009-09-16 12:57:24 UTC (rev 7228)
@@ -44,8 +44,8 @@
    */
   if (mayResize) {
     resizeHeap (s, s->lastMajorStatistics.bytesLive + bytesRequested);
-    setCardMapAndCrossMap (s);
   }
+  setCardMapAndCrossMap (s);
   resizeHeapSecondary (s);
   assert (s->heap.oldGenSize + bytesRequested <= s->heap.size);
 }




More information about the MLton-commit mailing list