[−][src]Struct lucet_module::HeapSpec
Specifications about the heap of a Lucet module.
Fields
reserved_size: u64
Total bytes of memory for the heap to possibly expand into, as configured for Cranelift codegen.
All of this memory is addressable. Only some part of it is accessible - from 0 to the
initial size, guaranteed, and up to the max_size
. This size allows Cranelift to elide
checks of the base pointer. At the moment that just means checking if it is greater than
4gb, in which case it can elide the base pointer check completely. In the future, Cranelift
could use a solver to elide more base pointer checks if it can prove the calculation will
always be less than this bound.
Specified in bytes, and must be evenly divisible by the host page size (4K).
guard_size: u64
Total bytes of memory after the reserved area, as configured for Cranelift codegen.
All of this memory is addressable, but it is never accessible - it is guaranteed to trap if an access happens in this region. This size allows Cranelift to use common subexpression elimination to reduce checks of the sum of base pointer and offset (where the offset is always rounded up to a multiple of the guard size, to be friendly to CSE).
Specified in bytes, and must be evenly divisible by the host page size (4K).
initial_size: u64
Total bytes of memory for the WebAssembly program's linear memory upon initialization.
Specified in bytes, must be evenly divisible by the WebAssembly page size (64K), and must be
less than or equal to reserved_size
.
max_size: Option<u64>
Maximum bytes of memory for the WebAssembly program's linear memory at any time.
This is not necessarily the same as reserved_size
- we want to be able to tune the check
bound there separately than the declaration of a max size in the client program.
The program may optionally define this value. If it does, it must be less than the
reserved_size
. If it does not, the max size is left up to the runtime, and is allowed to
be less than reserved_size
.
Methods
impl HeapSpec
[src]
pub fn new(
reserved_size: u64,
guard_size: u64,
initial_size: u64,
max_size: Option<u64>
) -> Self
[src]
reserved_size: u64,
guard_size: u64,
initial_size: u64,
max_size: Option<u64>
) -> Self
pub fn empty() -> Self
[src]
Some very small test programs dont specify a memory import or definition.
Trait Implementations
impl Clone for HeapSpec
[src]
impl Default for HeapSpec
[src]
impl Eq for HeapSpec
[src]
impl PartialEq<HeapSpec> for HeapSpec
[src]
impl Debug for HeapSpec
[src]
impl Serialize for HeapSpec
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for HeapSpec
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for HeapSpec
impl Sync for HeapSpec
impl Unpin for HeapSpec
impl UnwindSafe for HeapSpec
impl RefUnwindSafe for HeapSpec
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same<T> for T
type Output = T
Should always be Self