X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRetainerProfile.c;h=9ab12f1c4838db43a56cadd3d57be991f1eaeede;hb=9d431e0874212f64e43b05c98d540f5ec7b6e9a3;hp=de3ae0938707f2404a0d266024c788e85fe718c6;hpb=0bffc410964e1688ad80d277d53400659e697ab5;p=ghc-hetmet.git diff --git a/ghc/rts/RetainerProfile.c b/ghc/rts/RetainerProfile.c index de3ae09..9ab12f1 100644 --- a/ghc/rts/RetainerProfile.c +++ b/ghc/rts/RetainerProfile.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RetainerProfile.c,v 1.6 2002/12/11 15:36:47 simonmar Exp $ + * $Id: RetainerProfile.c,v 1.8 2003/03/21 16:18:37 sof Exp $ * * (c) The GHC Team, 2001 * Author: Sungwoo Park @@ -27,8 +27,6 @@ #include "Profiling.h" #include "Stats.h" #include "BlockAlloc.h" -#include "Itimer.h" -#include "Proftimer.h" #include "ProfHeap.h" #include "Apply.h" @@ -160,7 +158,7 @@ typedef struct { the topmost element on the previous block group so as to satisfy the invariants described above. */ -bdescr *firstStack = NULL; +static bdescr *firstStack = NULL; static bdescr *currentStack; static stackElement *stackBottom, *stackTop, *stackLimit; @@ -260,6 +258,21 @@ isEmptyRetainerStack( void ) } /* ----------------------------------------------------------------------------- + * Returns size of stack + * -------------------------------------------------------------------------- */ +lnat +retainerStackBlocks() +{ + bdescr* bd; + lnat res = 0; + + for (bd = firstStack; bd != NULL; bd = bd->link) + res += bd->blocks; + + return res; +} + +/* ----------------------------------------------------------------------------- * Returns rtsTrue if stackTop is at the stack boundary of the current stack, * i.e., if the current stack chunk is empty. * -------------------------------------------------------------------------- */