/* -----------------------------------------------------------------------------
- * $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
#include "Profiling.h"
#include "Stats.h"
#include "BlockAlloc.h"
-#include "Itimer.h"
-#include "Proftimer.h"
#include "ProfHeap.h"
#include "Apply.h"
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;
}
/* -----------------------------------------------------------------------------
+ * 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.
* -------------------------------------------------------------------------- */