Skip to content

Commit 054feef

Browse files

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/policy/immix/block.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ impl Block {
247247
if prev_line_is_marked {
248248
holes += 1;
249249
}
250-
250+
// We need to clear the line mark state at least twice in every 128 GC
251+
// otherwise, the line mark state of the last GC will stick around
252+
if line_mark_state > Line::MAX_MARK_STATE - 2 {
253+
line.mark(0);
254+
}
251255
#[cfg(feature = "immix_zero_on_release")]
252256
crate::util::memory::zero(line.start(), Line::BYTES);
253257

src/util/alloc/immix_allocator.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ impl<VM: VMBinding> ImmixAllocator<VM> {
298298
block.start(),
299299
block.end()
300300
);
301+
// Bulk clear stale line mark state
302+
Line::MARK_TABLE
303+
.bzero_metadata(block.start(), crate::policy::immix::block::Block::BYTES);
301304
if self.request_for_large {
302305
self.large_bump_pointer.cursor = block.start();
303306
self.large_bump_pointer.limit = block.end();

0 commit comments

Comments
 (0)