summaryrefslogtreecommitdiff
path: root/rts/sm/BlockAlloc.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-01-25 11:10:11 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-01-25 11:10:11 +0000
commit069cd16951bd45a55c94b5adce048c4ec9aad2c8 (patch)
tree4193098b120162a75ec70dafa19e876e73eacf67 /rts/sm/BlockAlloc.c
parente222292914f36f4e42c123a380508f570d5a5f46 (diff)
downloadhaskell-069cd16951bd45a55c94b5adce048c4ec9aad2c8.tar.gz
update debugging code for fragmentation
Diffstat (limited to 'rts/sm/BlockAlloc.c')
-rw-r--r--rts/sm/BlockAlloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c
index bf0c5e6a3b..0b8955c8fb 100644
--- a/rts/sm/BlockAlloc.c
+++ b/rts/sm/BlockAlloc.c
@@ -345,8 +345,9 @@ allocGroup (nat n)
}
if (ln == MAX_FREE_LIST) {
-#if 0
- if (((W_)mblocks_allocated * MBLOCK_SIZE_W - (W_)n_alloc_blocks * BLOCK_SIZE_W) > (1024*1024)/sizeof(W_)) {
+#if 0 /* useful for debugging fragmentation */
+ if ((W_)mblocks_allocated * BLOCKS_PER_MBLOCK * BLOCK_SIZE_W
+ - (W_)((n_alloc_blocks - n) * BLOCK_SIZE_W) > (2*1024*1024)/sizeof(W_)) {
debugBelch("Fragmentation, wanted %d blocks:", n);
RtsFlags.DebugFlags.block_alloc = 1;
checkFreeListSanity();