From: simonmar Date: Fri, 16 Sep 2005 09:59:26 +0000 (+0000) Subject: [project @ 2005-09-16 09:59:26 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~212 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9aae4de1909e118116afdc4a18accfea3ae68ce7;p=ghc-hetmet.git [project @ 2005-09-16 09:59:26 by simonmar] Add some missing cases to heapCensus(); should fix heap profiling of code that uses STM. --- diff --git a/ghc/rts/ProfHeap.c b/ghc/rts/ProfHeap.c index e9735e7..f98246c 100644 --- a/ghc/rts/ProfHeap.c +++ b/ghc/rts/ProfHeap.c @@ -906,6 +906,17 @@ heapCensusChain( Census *census, bdescr *bd ) size = sizeW_fromITBL(info); break; + case IND: + // Special case/Delicate Hack: INDs don't normally + // appear, since we're doing this heap census right + // after GC. However, GarbageCollect() also does + // resurrectThreads(), which can update some + // blackholes when it calls raiseAsync() on the + // resurrected threads. So we know that any IND will + // be the size of a BLACKHOLE. + size = BLACKHOLE_sizeW(); + break; + case BCO: prim = rtsTrue; size = bco_sizeW((StgBCO *)p); @@ -959,8 +970,28 @@ heapCensusChain( Census *census, bdescr *bd ) } #endif + case TREC_HEADER: + prim = rtsTrue; + size = sizeofW(StgTRecHeader); + break; + + case TVAR_WAIT_QUEUE: + prim = rtsTrue; + size = sizeofW(StgTVarWaitQueue); + break; + + case TVAR: + prim = rtsTrue; + size = sizeofW(StgTVar); + break; + + case TREC_CHUNK: + prim = rtsTrue; + size = sizeofW(StgTRecChunk); + break; + default: - barf("heapCensus"); + barf("heapCensus, unknown object: %d", info->type); } identity = NULL;