From: simonmar Date: Mon, 19 Aug 2002 16:02:26 +0000 (+0000) Subject: [project @ 2002-08-19 16:02:26 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1759 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=11fcbaeb156ebb1a89cd5e05960c599d8dcf5924;p=ghc-hetmet.git [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. --- diff --git a/ghc/rts/Stats.c b/ghc/rts/Stats.c index 546466d..5d4f772 100644 --- a/ghc/rts/Stats.c +++ b/ghc/rts/Stats.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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, "<>\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)),