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§
Provided Associated Constants§
Required Methods§
sourcefn 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.
Provided Methods§
sourcefn from_unaligned_address(address: Address) -> Self
fn from_unaligned_address(address: Address) -> Self
Create a region from an arbitrary address.
sourcefn is_aligned(address: Address) -> bool
fn is_aligned(address: Address) -> bool
Check if an address is aligned to the region.
sourcefn end(&self) -> Address
fn end(&self) -> Address
Return the end address of the region. Note that the end address is not in the region.
sourcefn containing(object: ObjectReference) -> Self
fn containing(object: ObjectReference) -> Self
Return the region that contains the object.
sourcefn includes_address(&self, addr: Address) -> bool
fn includes_address(&self, addr: Address) -> bool
Check if the given address is in the region.
Object Safety§
This trait is not object safe.