#[repr(transparent)]pub struct Block(Address);Expand description
Data structure to reference an immix block.
Tuple Fields§
§0: AddressImplementations§
Source§impl Block
impl Block
Sourcepub const DEFRAG_STATE_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_DEFRAG
pub const DEFRAG_STATE_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_DEFRAG
Block defrag state table (side)
Sourcepub const MARK_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_MARK
pub const MARK_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_MARK
Block mark table (side)
pub const LOG_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_LOG
pub const NURSERY_PROMOTION_STATE_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::NURSERY_PROMOTION_STATE
pub const ZERO: Self
const DEFRAG_SOURCE_STATE: u8 = 255u8
pub fn calc_dead_lines(&self) -> usize
pub fn is_zero(&self) -> bool
Sourcepub fn line_mark_table(&self) -> MetadataByteArrayRef<{ Block::LINES }>
pub fn line_mark_table(&self) -> MetadataByteArrayRef<{ Block::LINES }>
Get the address range of the block’s line mark table.
Sourcepub fn get_state(&self) -> BlockState
pub fn get_state(&self) -> BlockState
Get block mark state.
Sourcepub fn set_state(&self, state: BlockState)
pub fn set_state(&self, state: BlockState)
Set block mark state.
Sourcepub fn fetch_update_state(
&self,
f: impl FnMut(BlockState) -> Option<BlockState>,
) -> Result<BlockState, BlockState>
pub fn fetch_update_state( &self, f: impl FnMut(BlockState) -> Option<BlockState>, ) -> Result<BlockState, BlockState>
Set block mark state.
pub fn attempt_dealloc(&self, ignore_reusing_blocks: bool) -> bool
Sourcepub fn is_defrag_source(&self) -> bool
pub fn is_defrag_source(&self) -> bool
Test if the block is marked for defragmentation.
pub fn in_defrag_block(o: ObjectReference) -> bool
pub fn address_in_defrag_block(a: Address) -> bool
Sourcepub fn set_as_defrag_source(&self, defrag: bool)
pub fn set_as_defrag_source(&self, defrag: bool)
Mark the block for defragmentation.
Sourcepub fn init<VM: VMBinding>(
&self,
copy: bool,
reuse: bool,
space: &ImmixSpace<VM>,
)
pub fn init<VM: VMBinding>( &self, copy: bool, reuse: bool, space: &ImmixSpace<VM>, )
Initialize a clean block after acquired from page-resource.
Sourcepub fn deinit<VM: VMBinding>(&self, space: &ImmixSpace<VM>)
pub fn deinit<VM: VMBinding>(&self, space: &ImmixSpace<VM>)
Deinitalize a block before releasing.
pub fn start_line(&self) -> Line
pub fn end_line(&self) -> Line
Sourcepub fn lines(&self) -> RegionIterator<Line> ⓘ
pub fn lines(&self) -> RegionIterator<Line> ⓘ
Get the range of lines within the block.
pub fn clear_rc_table(&self)
pub fn clear_striddle_table(&self)
pub(crate) fn clear_mark_table<VM: VMBinding>(&self)
pub(crate) fn initialize_mark_table_as_marked<VM: VMBinding>(&self)
pub fn log(&self) -> bool
pub fn set_as_in_place_promoted(&self)
pub fn is_in_place_promoted(&self) -> bool
pub fn clear_in_place_promoted(&self)
pub fn unlog(&self)
pub fn clear_field_unlog_table<VM: VMBinding>(&self)
pub fn initialize_field_unlog_table_as_unlogged<VM: VMBinding>(&self)
pub fn rc_dead(&self) -> bool
Sourcepub fn sweep<VM: VMBinding>(
&self,
space: &ImmixSpace<VM>,
mark_histogram: &mut [usize; 17],
line_mark_state: Option<u8>,
) -> BlockSweepResult
pub fn sweep<VM: VMBinding>( &self, space: &ImmixSpace<VM>, mark_histogram: &mut [usize; 17], line_mark_state: Option<u8>, ) -> BlockSweepResult
Sweep this block.
pub fn rc_sweep_nursery<VM: VMBinding>(&self, space: &ImmixSpace<VM>) -> bool
pub fn attempt_mutator_reuse(&self) -> bool
pub fn rc_sweep_mature<VM: VMBinding>( &self, space: &ImmixSpace<VM>, defrag: bool, ) -> bool
pub fn rc_table_start(&self) -> Address
pub fn has_holes(&self) -> bool
Sourcepub fn clear_vo_bits_for_unmarked_regions(&self, line_mark_state: Option<u8>)
pub fn clear_vo_bits_for_unmarked_regions(&self, line_mark_state: Option<u8>)
Clear VO bits metadata for unmarked regions. This is useful for clearing VO bits during nursery GC for StickyImmix at which time young objects (allocated in unmarked regions) may die but we always consider old objects (in marked regions) as live.
Trait Implementations§
Source§impl BlockMayHaveObjects for Block
impl BlockMayHaveObjects for Block
Source§fn may_have_objects(&self) -> bool
fn may_have_objects(&self) -> bool
Return
true if the block may contain valid objects (objects with the VO bit set). Return
false otherwise. Read moreSource§impl PartialOrd for Block
impl PartialOrd for Block
Source§impl Region for Block
impl Region for Block
Source§fn from_aligned_address(address: Address) -> Self
fn from_aligned_address(address: Address) -> Self
Create a region from an address that is aligned to the region boundary. The method should panic if the address
is not properly aligned to the region. For performance, this method should always be inlined.
Source§fn start(&self) -> Address
fn start(&self) -> Address
Return the start address of the region. For performance, this method should always be inlined.
Source§fn from_unaligned_address(address: Address) -> Self
fn from_unaligned_address(address: Address) -> Self
Create a region from an arbitrary address.
Source§fn is_aligned(address: Address) -> bool
fn is_aligned(address: Address) -> bool
Check if an address is aligned to the region.
Source§fn end(&self) -> Address
fn end(&self) -> Address
Return the end address of the region. Note that the end address is not in the region.
Source§fn steps_between(start: &Self, end: &Self) -> Option<usize>
fn steps_between(start: &Self, end: &Self) -> Option<usize>
Get the number of lines between the given two lines.
Source§fn includes_address(&self, addr: Address) -> bool
fn includes_address(&self, addr: Address) -> bool
Check if the given address is in the region.
Source§impl UnstraddlableRegion for Block
An objects cannot straddle multiple Immix blocks.
impl UnstraddlableRegion for Block
An objects cannot straddle multiple Immix blocks.
Source§fn containing(object: ObjectReference) -> Self
fn containing(object: ObjectReference) -> Self
Return the region that contains the object.
Source§fn contains(&self, object: ObjectReference) -> bool
fn contains(&self, object: ObjectReference) -> bool
Reeturn whether a region contains an object.
impl Copy for Block
impl NoUninit for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more