sanity checking fixes
authorSimon Marlow <marlowsd@gmail.com>
Mon, 12 Jan 2009 12:10:42 +0000 (12:10 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 12 Jan 2009 12:10:42 +0000 (12:10 +0000)
rts/Sanity.c
rts/Sanity.h
rts/sm/GC.c
rts/sm/Storage.c

index 71eae44..20507ca 100644 (file)
@@ -794,7 +794,7 @@ checkGlobalTSOList (rtsBool checkTSOs)
           // be on the mutable list.
           if (tso->what_next == ThreadRelocated) continue;
           if (tso->flags & (TSO_DIRTY|TSO_LINK_DIRTY)) {
-              ASSERT(Bdescr((P_)tso)->gen_no == 0 || tso->flags & TSO_MARKED);
+              ASSERT(Bdescr((P_)tso)->gen_no == 0 || (tso->flags & TSO_MARKED));
               tso->flags &= ~TSO_MARKED;
           }
       }
@@ -824,7 +824,7 @@ checkMutableList( bdescr *mut_bd, nat gen )
 }
 
 void
-checkMutableLists (void)
+checkMutableLists (rtsBool checkTSOs)
 {
     nat g, i;
 
@@ -834,7 +834,7 @@ checkMutableLists (void)
             checkMutableList(capabilities[i].mut_lists[g], g);
         }
     }
-    checkGlobalTSOList(rtsTrue);
+    checkGlobalTSOList(checkTSOs);
 }
 
 /*
index b86dc97..05803df 100644 (file)
@@ -29,7 +29,7 @@ extern StgOffset checkStackFrame ( StgPtr sp );
 extern StgOffset checkClosure  ( StgClosure* p );
 
 extern void checkMutableList   ( bdescr *bd, nat gen );
-extern void checkMutableLists (void);
+extern void checkMutableLists ( rtsBool checkTSOs );
 
 #if defined(GRAN)
 extern void checkTSOsSanity(void);
index 2af5fa1..e44a310 100644 (file)
@@ -266,7 +266,7 @@ GarbageCollect (rtsBool force_major_gc,
 
   // check stack sanity *before* GC
   IF_DEBUG(sanity, checkFreeListSanity());
-  IF_DEBUG(sanity, checkMutableLists());
+  IF_DEBUG(sanity, checkMutableLists(rtsTrue));
 
   // Initialise all our gc_thread structures
   for (t = 0; t < n_gc_threads; t++) {
index 6f6d591..36741a6 100644 (file)
@@ -1483,9 +1483,6 @@ checkSanity( void )
                       == generations[g].steps[s].n_large_blocks);
                checkHeap(generations[g].steps[s].blocks);
                checkChain(generations[g].steps[s].large_objects);
-               if (g > 0) {
-                   checkMutableList(generations[g].mut_list, g);
-               }
            }
        }
 
@@ -1502,9 +1499,9 @@ checkSanity( void )
 #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);
+    checkMutableLists(rtsTrue);
 #else
-    checkGlobalTSOList(rtsFalse);
+    checkMutableLists(rtsFalse);
 #endif
 }