diff options
author | Tobias Guggenmos <tguggenm@redhat.com> | 2019-09-07 15:32:06 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-03 12:17:33 -0400 |
commit | 47386fe85a412c8aa35f6bcbce0d41f0eed03b65 (patch) | |
tree | eb269c7dd0f13ee5803d22a6bd5009596bcda17b /rts/sm/BlockAlloc.c | |
parent | ee6324adfed737fbf9ca3c36538145542b425617 (diff) | |
download | haskell-47386fe85a412c8aa35f6bcbce0d41f0eed03b65.tar.gz |
Add new debug flag -DZ
Zeros heap memory after gc freed it.
Diffstat (limited to 'rts/sm/BlockAlloc.c')
-rw-r--r-- | rts/sm/BlockAlloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index bbb4f8a6c1..f9e3d11407 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -456,7 +456,7 @@ allocGroupOnNode (uint32_t node, W_ n) } finish: - IF_DEBUG(sanity, memset(bd->start, 0xaa, bd->blocks * BLOCK_SIZE)); + IF_DEBUG(zero_on_gc, memset(bd->start, 0xaa, bd->blocks * BLOCK_SIZE)); IF_DEBUG(sanity, checkFreeListSanity()); return bd; } @@ -531,7 +531,7 @@ bdescr* allocLargeChunkOnNode (uint32_t node, W_ min, W_ max) recordAllocatedBlocks(node, bd->blocks); - IF_DEBUG(sanity, memset(bd->start, 0xaa, bd->blocks * BLOCK_SIZE)); + IF_DEBUG(zero_on_gc, memset(bd->start, 0xaa, bd->blocks * BLOCK_SIZE)); IF_DEBUG(sanity, checkFreeListSanity()); return bd; } @@ -656,7 +656,7 @@ freeGroup(bdescr *p) p->gen = NULL; p->gen_no = 0; /* fill the block group with garbage if sanity checking is on */ - IF_DEBUG(sanity,memset(p->start, 0xaa, (W_)p->blocks * BLOCK_SIZE)); + IF_DEBUG(zero_on_gc, memset(p->start, 0xaa, (W_)p->blocks * BLOCK_SIZE)); if (p->blocks == 0) barf("freeGroup: block size is zero"); |