[project @ 2005-09-12 15:51:10 by simonmar]
authorsimonmar <unknown>
Mon, 12 Sep 2005 15:51:10 +0000 (15:51 +0000)
committersimonmar <unknown>
Mon, 12 Sep 2005 15:51:10 +0000 (15:51 +0000)
- Fix IND case
- Add a useful function for debugging: onMutList()

ghc/rts/Sanity.c

index 97abd3c..d6b04a1 100644 (file)
@@ -356,12 +356,9 @@ checkClosure( StgClosure* p )
            /* we don't expect to see any of these after GC
             * but they might appear during execution
             */
-           P_ q;
            StgInd *ind = (StgInd *)p;
            ASSERT(LOOKS_LIKE_CLOSURE_PTR(ind->indirectee));
-           q = (P_)p + sizeofW(StgInd);
-           while (!*q) { q++; }; /* skip padding words (see GC.c: evacuate())*/
-           return q - (P_)p;
+           return sizeofW(StgHeader) + MIN_UPD_SIZE;
        }
 
     case RET_BCO:
@@ -940,4 +937,15 @@ checkLAGAtable(rtsBool check_closures)
 }
 #endif
 
+int
+onMutList(StgMutClosure *p, StgMutClosure *mut)
+{
+    int i;
+    for (i=0; mut != END_MUT_LIST; i++) {
+       if (mut == p) return i;
+       mut = mut->mut_link;
+    }
+    return -1;
+}
+
 #endif /* DEBUG */