Commit 11fcbaeb authored by simonmar's avatar simonmar

[project @ 2002-08-19 16:02:26 by simonmar]

Protect against divide by zero when there have been zero major GCs in
the one-line stats mode.
parent da80052b
/* -----------------------------------------------------------------------------
* $Id: Stats.c,v 1.45 2002/08/16 13:29:07 simonmar Exp $
* $Id: Stats.c,v 1.46 2002/08/19 16:02:26 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -749,7 +749,8 @@ stat_exit(int alloc)
fprintf(sf, "<<ghc: %llu bytes, ", GC_tot_alloc*sizeof(W_));
fprintf(sf, "%d GCs, %ld/%ld avg/max bytes residency (%ld samples), %luM in use, %.2f INIT (%.2f elapsed), %.2f MUT (%.2f elapsed), %.2f GC (%.2f elapsed) :ghc>>\n",
total_collections,
AvgResidency*sizeof(W_)/ResidencySamples,
ResidencySamples == 0 ? 0 :
AvgResidency*sizeof(W_)/ResidencySamples,
MaxResidency*sizeof(W_),
ResidencySamples,
(unsigned long)(mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment