[commit: ghc] master: memInventory(): tweak pretty-printing (d68865d)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/d68865de2aa654d91e57c17437559b005e00b909

>---------------------------------------------------------------

commit d68865de2aa654d91e57c17437559b005e00b909
Author: Simon Marlow <[email protected]>
Date:   Fri Sep 7 13:35:00 2012 +0100

    memInventory(): tweak pretty-printing

>---------------------------------------------------------------

 rts/sm/Sanity.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c
index 99cea93..ec8921c 100644
--- a/rts/sm/Sanity.c
+++ b/rts/sm/Sanity.c
@@ -906,7 +906,7 @@ memInventory (rtsBool show)
   live_blocks += nursery_blocks + 
                + retainer_blocks + arena_blocks + exec_blocks;
 
-#define MB(n) (((n) * BLOCK_SIZE_W) / ((1024*1024)/sizeof(W_)))
+#define MB(n) (((double)(n) * BLOCK_SIZE_W) / ((1024*1024)/sizeof(W_)))
 
   leak = live_blocks + free_blocks != mblocks_allocated * BLOCKS_PER_MBLOCK;
 
@@ -918,20 +918,20 @@ memInventory (rtsBool show)
           debugBelch("Memory inventory:\n");
       }
       for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
-	  debugBelch("  gen %d blocks : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n", g, 
+          debugBelch("  gen %d blocks : %5" FMT_SizeT " blocks (%6.1lf MB)\n", g,
                      gen_blocks[g], MB(gen_blocks[g]));
       }
-      debugBelch("  nursery      : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n", 
+      debugBelch("  nursery      : %5" FMT_SizeT " blocks (%6.1lf MB)\n",
                  nursery_blocks, MB(nursery_blocks));
-      debugBelch("  retainer     : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n", 
+      debugBelch("  retainer     : %5" FMT_SizeT " blocks (%6.1lf MB)\n",
                  retainer_blocks, MB(retainer_blocks));
-      debugBelch("  arena blocks : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n", 
+      debugBelch("  arena blocks : %5" FMT_SizeT " blocks (%6.1lf MB)\n",
                  arena_blocks, MB(arena_blocks));
-      debugBelch("  exec         : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n", 
+      debugBelch("  exec         : %5" FMT_SizeT " blocks (%6.1lf MB)\n",
                  exec_blocks, MB(exec_blocks));
-      debugBelch("  free         : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n", 
+      debugBelch("  free         : %5" FMT_SizeT " blocks (%6.1lf MB)\n",
                  free_blocks, MB(free_blocks));
-      debugBelch("  total        : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n",
+      debugBelch("  total        : %5" FMT_SizeT " blocks (%6.1lf MB)\n",
                  live_blocks + free_blocks, MB(live_blocks+free_blocks));
       if (leak) {
           debugBelch("\n  in system    : %5" FMT_SizeT " blocks (%" FMT_SizeT " MB)\n",
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.