Skip to content

Commit e686077

Browse files
add immix_zero_on_release (#736)
Add `immix_zero_on_release` feature to assist debugging.
1 parent 0dbdb7c commit e686077

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ object_pinning = []
9595
immix_no_defrag = []
9696
# Reduce block size for ImmixSpace. This mitigates fragmentation when defrag is disabled.
9797
immix_smaller_block = []
98+
# Zero the unmarked lines after a GC cycle in immix. This helps debug untraced objects.
99+
immix_zero_on_release = []
98100

99101
# Run sanity GC
100102
sanity = []

src/policy/immix/block.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ impl Block {
240240
if prev_line_is_marked {
241241
holes += 1;
242242
}
243+
244+
#[cfg(feature = "immix_zero_on_release")]
245+
crate::util::memory::zero(line.start(), Line::BYTES);
246+
243247
prev_line_is_marked = false;
244248
}
245249
}

0 commit comments

Comments
 (0)