Struct mmtk::policy::immix::block::Block

source ·
#[repr(transparent)]
pub struct Block(Address);
Expand description

Data structure to reference an immix block.

Tuple Fields§

§0: Address

Implementations§

source§

impl Block

source

pub const LOG_PAGES: usize = 1usize

Log pages in block

source

pub const PAGES: usize = 2usize

Pages in block

source

pub const LOG_LINES: usize = 5usize

Log lines in block

source

pub const LINES: usize = 32usize

Lines in block

source

pub const DEFRAG_STATE_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_DEFRAG

Block defrag state table (side)

source

pub const MARK_TABLE: SideMetadataSpec = crate::util::metadata::side_metadata::spec_defs::IX_BLOCK_MARK

Block mark table (side)

source

pub fn chunk(&self) -> Chunk

Get the chunk containing the block.

source

pub fn line_mark_table(&self) -> MetadataByteArrayRef<{ Block::LINES }>

Get the address range of the block’s line mark table.

source

pub fn get_state(&self) -> BlockState

Get block mark state.

source

pub fn set_state(&self, state: BlockState)

Set block mark state.

source

const DEFRAG_SOURCE_STATE: u8 = 255u8

source

pub fn is_defrag_source(&self) -> bool

Test if the block is marked for defragmentation.

source

pub fn set_as_defrag_source(&self, defrag: bool)

Mark the block for defragmentation.

source

pub fn set_holes(&self, holes: usize)

Record the number of holes in the block.

source

pub fn get_holes(&self) -> usize

Get the number of holes.

source

pub fn init(&self, copy: bool)

Initialize a clean block after acquired from page-resource.

source

pub fn deinit(&self)

Deinitalize a block before releasing.

source

pub fn start_line(&self) -> Line

source

pub fn end_line(&self) -> Line

source

pub fn lines(&self) -> RegionIterator<Line>

Get the range of lines within the block.

source

pub fn sweep<VM: VMBinding>( &self, space: &ImmixSpace<VM>, mark_histogram: &mut [usize; 17], line_mark_state: Option<u8> ) -> bool

Sweep this block. Return true if the block is swept.

source

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

source§

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 more
source§

impl Clone for Block

source§

fn clone(&self) -> Block

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Block

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Block

source§

fn eq(&self, other: &Block) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Block

source§

fn partial_cmp(&self, other: &Block) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Region for Block

source§

const LOG_BYTES: usize = 13usize

log2 of the size in bytes for the region.
source§

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

Return the start address of the region. For performance, this method should always be inlined.
source§

const BYTES: usize = _

The size in bytes for the region.
source§

fn from_unaligned_address(address: Address) -> Self

Create a region from an arbitrary address.
source§

fn align(address: Address) -> Address

Align the address to the region.
source§

fn is_aligned(address: Address) -> bool

Check if an address is aligned to the region.
source§

fn end(&self) -> Address

Return the end address of the region. Note that the end address is not in the region.
source§

fn next(&self) -> Self

Return the next region after this one.
source§

fn next_nth(&self, n: usize) -> Self

Return the next nth region after this one.
source§

fn containing(object: ObjectReference) -> Self

Return the region that contains the object.
source§

fn includes_address(&self, addr: Address) -> bool

Check if the given address is in the region.
source§

impl Copy for Block

source§

impl StructuralPartialEq for Block

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.