Skip to content

Commit

Permalink
[project @ 2005-09-16 09:59:26 by simonmar]
Browse files Browse the repository at this point in the history
Add some missing cases to heapCensus(); should fix heap profiling of
code that uses STM.
  • Loading branch information
simonmar committed Sep 16, 2005
1 parent 76f99ef commit 9aae4de
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion ghc/rts/ProfHeap.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9aae4de

Please sign in to comment.