From 3d07a88927642d6b74684a2f64c5514590e6691a Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 12 Sep 2005 15:51:10 +0000 Subject: [PATCH] [project @ 2005-09-12 15:51:10 by simonmar] - Fix IND case - Add a useful function for debugging: onMutList() --- ghc/rts/Sanity.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 */ -- 1.7.10.4