pub struct VMLayout {
pub log_address_space: usize,
pub heap_start: Address,
pub heap_end: Address,
pub log_space_extent: usize,
pub force_use_contiguous_spaces: bool,
}
Expand description
Runtime-initialized virtual memory constants
Fields§
§log_address_space: usize
log_2 of the addressable heap virtual space.
heap_start: Address
Lowest virtual address used by the virtual machine. Should be chunk aligned.
heap_end: Address
Highest virtual address used by the virtual machine. Should be chunk aligned.
log_space_extent: usize
An upper bound on the extent of any space in the current memory layout
force_use_contiguous_spaces: bool
Should mmtk enable contiguous spaces and virtual memory for all spaces? For normal 64-bit config, this should be set to true. Each space should own a contiguous piece of virtual memory. For 32-bit or 64-bit compressed heap, we don’t have enough virtual memory, so this should be set to false.
Implementations§
source§impl VMLayout
impl VMLayout
sourcepub const LOG_ARCH_ADDRESS_SPACE: usize = 47usize
pub const LOG_ARCH_ADDRESS_SPACE: usize = 47usize
The maximum virtual memory address space that can be used on the target.
sourcepub const fn max_space_extent(&self) -> usize
pub const fn max_space_extent(&self) -> usize
An upper bound on the extent of any space in the current memory layout
sourcepub const fn available_start(&self) -> Address
pub const fn available_start(&self) -> Address
Lowest virtual address available for MMTk to manage.
sourcepub const fn available_end(&self) -> Address
pub const fn available_end(&self) -> Address
Highest virtual address available for MMTk to manage.
sourcepub const fn available_bytes(&self) -> usize
pub const fn available_bytes(&self) -> usize
Size of the address space available to the MMTk heap.
sourcepub const fn max_chunks(&self) -> usize
pub const fn max_chunks(&self) -> usize
Maximum number of chunks we need to track. Only used in 32-bit layout.
sourcepub const fn log_max_chunks(&self) -> usize
pub const fn log_max_chunks(&self) -> usize
log_2 of the maximum number of chunks we need to track. Only used in 32-bit layout.
sourcepub(crate) fn space_shift_64(&self) -> usize
pub(crate) fn space_shift_64(&self) -> usize
Number of bits to shift a space index into/out of a virtual address. In a 32-bit model, use a dummy value so that the compiler doesn’t barf.
sourcepub(crate) fn space_mask_64(&self) -> usize
pub(crate) fn space_mask_64(&self) -> usize
Bitwise mask to isolate a space index in a virtual address. We can’t express this constant in a 32-bit environment, hence the conditional definition.
sourcepub(crate) fn space_size_64(&self) -> usize
pub(crate) fn space_size_64(&self) -> usize
Size of each space in the 64-bit memory layout We can’t express this constant in a 32-bit environment, hence the conditional definition. FIXME: When Compiling for 32 bits this expression makes no sense
sourcepub(crate) fn log_pages_in_space64(&self) -> usize
pub(crate) fn log_pages_in_space64(&self) -> usize
log_2 of the number of pages in a 64-bit space
sourcepub(crate) fn pages_in_space64(&self) -> usize
pub(crate) fn pages_in_space64(&self) -> usize
The number of pages in a 64-bit space
sourcepub(crate) fn address_mask(&self) -> usize
pub(crate) fn address_mask(&self) -> usize
This mask extracts a few bits from address, and use it as index to the space map table. When masked with this constant, the index is 1 to 16. If we mask any arbitrary address with this mask, we will get 0 to 31 (32 entries).
const fn validate(&self)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for VMLayout
impl Send for VMLayout
impl Sync for VMLayout
impl Unpin for VMLayout
impl UnwindSafe for VMLayout
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
§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>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
&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
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>
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>
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