From ba41623270c1d541e74bd5182e1b4fcbe99809cc Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 17 Jan 2006 13:50:06 +0000 Subject: [PATCH] [project @ 2006-01-17 13:50:06 by simonmar] statDescribeGens: count large blocks in the "live" figure --- ghc/rts/Stats.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ghc/rts/Stats.c b/ghc/rts/Stats.c index 5292019..28d09bd 100644 --- a/ghc/rts/Stats.c +++ b/ghc/rts/Stats.c @@ -543,7 +543,8 @@ stat_exit(int alloc) void statDescribeGens(void) { - nat g, s, mut, lge, live; + nat g, s, mut, lge; + lnat live; bdescr *bd; step *step; @@ -562,10 +563,15 @@ statDescribeGens(void) for (s = 0; s < generations[g].n_steps; s++) { step = &generations[g].steps[s]; - for (bd = step->large_objects, lge = 0; bd; bd = bd->link) - lge++; live = 0; + for (bd = step->large_objects, lge = 0; bd; bd = bd->link) { + lge++; + } + live = step->n_large_blocks * BLOCK_SIZE; bd = step->blocks; + // This live figure will be slightly less that the "live" figure + // given by +RTS -Sstderr, because we take don't count the + // slop at the end of each block. for (; bd; bd = bd->link) { live += (bd->free - bd->start) * sizeof(W_); } -- 1.7.10.4