Skip to content

Zero any slop after compaction in compacting GC

In copying GC, with the relevant debug flags enabled, we release the old blocks after a GC, and the block allocator zeroes the space before releasing a block. This effectively zeros the old heap.

In compacting GC we reuse the blocks and previously we didn't zero the unused space in a compacting generation after compaction. With this patch we zero the slop between the free pointer and the end of the block when we're done with compaction and when switching to a new block (because the current block doesn't have enough space for the next object we're shifting).


I tested this using a default build (no build.mk), with command make EXTRA_HC_OPTS="-debug -with-rtsopts=-c -with-rtsopts=-DZ".

@simonmar @bgamari could you review?

Merge request reports