From 9aae4de1909e118116afdc4a18accfea3ae68ce7 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 16 Sep 2005 09:59:26 +0000 Subject: [PATCH] [project @ 2005-09-16 09:59:26 by simonmar] Add some missing cases to heapCensus(); should fix heap profiling of code that uses STM. --- ghc/rts/ProfHeap.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) 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; -- 1.7.10.4