scheduleDoGC: if we're doing heapCensus(), do it *before* releasing
authorSimon Marlow <marlowsd@gmail.com>
Wed, 11 May 2011 10:00:10 +0000 (11:00 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 11 May 2011 10:54:02 +0000 (11:54 +0100)
the other mutator threads (#5127)

rts/Schedule.c

index f5cb568..9636223 100644 (file)
@@ -1447,6 +1447,12 @@ delete_threads_and_gc:
         recent_activity = ACTIVITY_YES;
     }
 
+    if (heap_census) {
+        debugTrace(DEBUG_sched, "performing heap census");
+        heapCensus();
+       performHeapProfile = rtsFalse;
+    }
+
 #if defined(THREADED_RTS)
     if (gc_type == PENDING_GC_PAR)
     {
@@ -1454,12 +1460,6 @@ delete_threads_and_gc:
     }
 #endif
 
-    if (heap_census) {
-        debugTrace(DEBUG_sched, "performing heap census");
-        heapCensus();
-       performHeapProfile = rtsFalse;
-    }
-
     if (heap_overflow && sched_state < SCHED_INTERRUPTING) {
         // GC set the heap_overflow flag, so we should proceed with
         // an orderly shutdown now.  Ultimately we want the main