From: simonmar Date: Mon, 12 Sep 2005 15:51:10 +0000 (+0000) Subject: [project @ 2005-09-12 15:51:10 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~224 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3d07a88927642d6b74684a2f64c5514590e6691a;p=ghc-hetmet.git [project @ 2005-09-12 15:51:10 by simonmar] - Fix IND case - Add a useful function for debugging: onMutList() --- diff --git a/ghc/rts/Sanity.c b/ghc/rts/Sanity.c index 97abd3c..d6b04a1 100644 --- a/ghc/rts/Sanity.c +++ b/ghc/rts/Sanity.c @@ -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 */