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

source

pub const LOG_ARCH_ADDRESS_SPACE: usize = 47usize

The maximum virtual memory address space that can be used on the target.

source

pub const fn max_space_extent(&self) -> usize

An upper bound on the extent of any space in the current memory layout

source

pub const fn available_start(&self) -> Address

Lowest virtual address available for MMTk to manage.

source

pub const fn available_end(&self) -> Address

Highest virtual address available for MMTk to manage.

source

pub const fn available_bytes(&self) -> usize

Size of the address space available to the MMTk heap.

source

pub const fn max_chunks(&self) -> usize

Maximum number of chunks we need to track. Only used in 32-bit layout.

source

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.

source

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.

source

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.

source

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

source

pub(crate) fn log_pages_in_space64(&self) -> usize

log_2 of the number of pages in a 64-bit space

source

pub(crate) fn pages_in_space64(&self) -> usize

The number of pages in a 64-bit space

source

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).

source

const fn validate(&self)

source§

impl VMLayout

source

pub const fn new_32bit() -> Self

Normal 32-bit configuration

source

pub const fn new_64bit() -> Self

Normal 64-bit configuration

source

pub(crate) fn set_custom_vm_layout(constants: VMLayout)

Custom VM layout constants. VM bindings may use this function for compressed or 39-bit heap support. This function must be called before MMTk::new()

Trait Implementations§

source§

impl Clone for VMLayout

source§

fn clone(&self) -> VMLayout

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 VMLayout

source§

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

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

impl Default for VMLayout

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.