Move checkGlobalTSOList() call from GarbageCollect() to checkSanity()
authorSimon Marlow <marlowsd@gmail.com>
Tue, 9 Sep 2008 13:34:53 +0000 (13:34 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 9 Sep 2008 13:34:53 +0000 (13:34 +0000)
rts/sm/GC.c
rts/sm/Storage.c

index c254fcb..f8a0980 100644 (file)
@@ -494,8 +494,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;
index 9e820ff..6cccf34 100644 (file)
@@ -1395,6 +1395,14 @@ checkSanity( void )
            
        checkFreeListSanity();
     }
+
+#if defined(THREADED_RTS)
+    // check the stacks too in threaded mode, because we don't do a
+    // full heap sanity check in this case (see checkHeap())
+    checkGlobalTSOList(rtsTrue);
+#else
+    checkGlobalTSOList(rtsFalse);
+#endif
 }
 
 /* Nursery sanity check */