Struct polkavm_common::abi::MemoryMap
source · #[repr(C)]pub struct MemoryMap { /* private fields */ }
Expand description
The memory map of a given guest program.
Implementations§
source§impl MemoryMap
impl MemoryMap
sourcepub fn new(
page_size: u32,
ro_data_size: u32,
rw_data_size: u32,
stack_size: u32,
) -> Result<Self, &'static str>
pub fn new( page_size: u32, ro_data_size: u32, rw_data_size: u32, stack_size: u32, ) -> Result<Self, &'static str>
Calculates the memory map from the given parameters.
sourcepub fn max_heap_size(&self) -> u32
pub fn max_heap_size(&self) -> u32
The maximum size of the program’s heap.
sourcepub fn ro_data_address(&self) -> u32
pub fn ro_data_address(&self) -> u32
The address at where the program’s read-only data starts inside of the VM.
sourcepub fn ro_data_size(&self) -> u32
pub fn ro_data_size(&self) -> u32
The size of the program’s read-only data.
sourcepub fn ro_data_range(&self) -> Range<u32>
pub fn ro_data_range(&self) -> Range<u32>
The range of addresses where the program’s read-only data is inside of the VM.
sourcepub fn rw_data_address(&self) -> u32
pub fn rw_data_address(&self) -> u32
The address at where the program’s read-write data starts inside of the VM.
sourcepub fn rw_data_size(&self) -> u32
pub fn rw_data_size(&self) -> u32
The size of the program’s read-write data.
sourcepub fn rw_data_range(&self) -> Range<u32>
pub fn rw_data_range(&self) -> Range<u32>
The range of addresses where the program’s read-write data is inside of the VM.
sourcepub fn stack_address_low(&self) -> u32
pub fn stack_address_low(&self) -> u32
The address at where the program’s stack starts inside of the VM.
sourcepub fn stack_address_high(&self) -> u32
pub fn stack_address_high(&self) -> u32
The address at where the program’s stack ends inside of the VM.
sourcepub fn stack_size(&self) -> u32
pub fn stack_size(&self) -> u32
The size of the program’s stack.
sourcepub fn stack_range(&self) -> Range<u32>
pub fn stack_range(&self) -> Range<u32>
The range of addresses where the program’s stack is inside of the VM.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryMap
impl RefUnwindSafe for MemoryMap
impl Send for MemoryMap
impl Sync for MemoryMap
impl Unpin for MemoryMap
impl UnwindSafe for MemoryMap
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)