[][src]Struct lucet_runtime_internals::alloc::Slot

#[repr(C)]
pub struct Slot {
    pub start: *mut c_void,
    pub heap: *mut c_void,
    pub stack: *mut c_void,
    pub globals: *mut c_void,
    pub sigstack: *mut c_void,
    pub limits: Limits,
    pub region: Weak<dyn RegionInternal>,
}

A set of pointers into virtual memory that can be allocated into an Alloc.

The 'r lifetime parameter represents the lifetime of the region that backs this virtual address space.

The memory layout in a Slot is meant to be reused in order to reduce overhead on region implementations. To back the layout with real memory, use Region::allocate_runtime.

To ensure a Slot can only be backed by one allocation at a time, it contains a mutex, but otherwise can be freely copied.

Fields

start: *mut c_void

The beginning of the contiguous virtual memory chunk managed by this Alloc.

The first part of this memory, pointed to by start, is always backed by real memory, and is used to store the lucet_instance structure.

heap: *mut c_void

The next part of memory contains the heap and its guard pages.

The heap is backed by real memory according to the HeapSpec. Guard pages trigger a sigsegv when accessed.

stack: *mut c_void

The stack comes after the heap.

Because the stack grows downwards, we get the added safety of ensuring that stack overflows go into the guard pages, if the Limits specify guard pages. The stack is always the size given by Limits.stack_pages.

globals: *mut c_void

The WebAssembly Globals follow the stack and a single guard page.

sigstack: *mut c_void

The signal handler stack follows the globals.

Having a separate signal handler stack allows the signal handler to run in situations where the normal stack has grown into the guard page.

limits: Limits

Limits of the memory.

Should not change through the lifetime of the Alloc.

region: Weak<dyn RegionInternal>

Methods

impl Slot[src]

pub fn stack_top(&self) -> *mut c_void[src]

Trait Implementations

impl Send for Slot[src]

impl Sync for Slot[src]

Auto Trait Implementations

impl Unpin for Slot

impl !UnwindSafe for Slot

impl !RefUnwindSafe for Slot

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self