Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/policy/immix/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use crate::util::linear_scan::{Region, RegionIterator};
use crate::util::metadata::side_metadata::{MetadataByteArrayRef, SideMetadataSpec};
#[cfg(feature = "vo_bit")]
use crate::util::metadata::vo_bit;
#[cfg(feature = "object_pinning")]
use crate::util::metadata::MetadataSpec;
use crate::util::Address;
use crate::vm::*;
use std::sync::atomic::Ordering;
Expand Down Expand Up @@ -201,6 +203,15 @@ impl Block {
#[cfg(feature = "vo_bit")]
vo_bit::helper::on_region_swept::<VM, _>(self, false);

// If the pin bit is not on the side, we cannot bulk zero.
// We shouldn't need to clear it here in that case, since the pin bit
// should be overwritten at each object allocation. The same applies below
// when we are sweeping on a line granularity.
#[cfg(feature = "object_pinning")]
if let MetadataSpec::OnSide(side) = *VM::VMObjectModel::LOCAL_PINNING_BIT_SPEC {
side.bzero_metadata(self.start(), Block::BYTES);
}

// Release the block if it is allocated but not marked by the current GC.
space.release_block(*self);
true
Expand Down Expand Up @@ -233,6 +244,12 @@ impl Block {
#[cfg(feature = "immix_zero_on_release")]
crate::util::memory::zero(line.start(), Line::BYTES);

// We need to clear the pin bit if it is on the side, as this line can be reused
#[cfg(feature = "object_pinning")]
if let MetadataSpec::OnSide(side) = *VM::VMObjectModel::LOCAL_PINNING_BIT_SPEC {
side.bzero_metadata(line.start(), Line::BYTES);
}

prev_line_is_marked = false;
}
}
Expand Down