[project @ 2004-08-13 13:04:50 by simonmar]
[ghc-hetmet.git] / ghc / rts / Stats.c
index 546466d..4920b4b 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stats.c,v 1.45 2002/08/16 13:29:07 simonmar Exp $
+ * $Id: Stats.c,v 1.48 2004/08/13 13:10:45 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
 #include "Rts.h"
 #include "RtsFlags.h"
 #include "RtsUtils.h"
-#include "StoragePriv.h"
 #include "MBlock.h"
 #include "Schedule.h"
 #include "Stats.h"
 #include "ParTicky.h"                       /* ToDo: move into Rts.h */
 #include "Profiling.h"
+#include "Storage.h"
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -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)),
@@ -820,5 +821,5 @@ statDescribeGens(void)
    each compilation and expression evaluation.
    -------------------------------------------------------------------------- */
 
-extern HsInt getAllocations( void ) 
-{ return (HsInt)(total_allocated * sizeof(W_)); }
+extern HsInt64 getAllocations( void ) 
+{ return (HsInt64)total_allocated * sizeof(W_); }