Trait mmtk::util::linear_scan::Region

source ·
pub trait Region: Copy + PartialEq + PartialOrd {
    const LOG_BYTES: usize;
    const BYTES: usize = _;

    // Required methods
    fn from_aligned_address(address: Address) -> Self;
    fn start(&self) -> Address;

    // Provided methods
    fn from_unaligned_address(address: Address) -> Self { ... }
    fn align(address: Address) -> Address { ... }
    fn is_aligned(address: Address) -> bool { ... }
    fn end(&self) -> Address { ... }
    fn next(&self) -> Self { ... }
    fn next_nth(&self, n: usize) -> Self { ... }
    fn containing(object: ObjectReference) -> Self { ... }
    fn includes_address(&self, addr: Address) -> bool { ... }
}
Expand description

Region represents a memory region with a properly aligned address as its start and a fixed size for the region. Region provides a set of utility methods, along with a RegionIterator that linearly scans at the step of a region.

Required Associated Constants§

source

const LOG_BYTES: usize

log2 of the size in bytes for the region.

Provided Associated Constants§

source

const BYTES: usize = _

The size in bytes for the region.

Required Methods§

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.

Provided Methods§

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Region for mmtk::policy::immix::block::Block

source§

const LOG_BYTES: usize = 13usize

source§

impl Region for Line

source§

const LOG_BYTES: usize = 8usize

source§

impl Region for mmtk::policy::marksweepspace::native_ms::block::Block

source§

const LOG_BYTES: usize = 16usize

source§

impl Region for Chunk

source§

const LOG_BYTES: usize = 22usize