Add ASSERTs to all calls of nameModule
[ghc-hetmet.git] / rts / sm / GC.c
index c254fcb..84a15fb 100644 (file)
@@ -268,8 +268,9 @@ GarbageCollect ( rtsBool force_major_gc )
   memInventory(traceClass(DEBUG_gc));
 #endif
 
-  // check stack sanity *before* GC (ToDo: check all threads) 
+  // check stack sanity *before* GC
   IF_DEBUG(sanity, checkFreeListSanity());
+  IF_DEBUG(sanity, checkMutableLists());
 
   // Initialise all our gc_thread structures
   for (t = 0; t < n_gc_threads; t++) {
@@ -494,8 +495,6 @@ GarbageCollect ( rtsBool force_major_gc )
           sweep(&oldest_gen->steps[0]);
   }
 
-  IF_DEBUG(sanity, checkGlobalTSOList(rtsFalse));
-
   /* run through all the generations/steps and tidy up 
    */
   copied = 0;
@@ -725,6 +724,11 @@ GarbageCollect ( rtsBool force_major_gc )
   // Update the stable pointer hash table.
   updateStablePtrTable(major_gc);
 
+  // Remove useless sparks from the spark pools
+#ifdef THREADED_RTS
+  pruneSparkQueues();
+#endif
+
   // check sanity after GC 
   IF_DEBUG(sanity, checkSanity());