[][src]Struct wasmer::BaseTunables

pub struct BaseTunables {
    pub static_memory_bound: Pages,
    pub static_memory_offset_guard_size: u64,
    pub dynamic_memory_offset_guard_size: u64,
}

Tunable parameters for WebAssembly compilation. This is the reference implementation of the Tunables trait, used by default.

You can use this as a template for creating a custom Tunables implementation or use composition to wrap your Tunables around this one. The later approach is demonstrated in the tunables-limit-memory example.

Fields

static_memory_bound: Pages

For static heaps, the size in wasm pages of the heap protected by bounds checking.

static_memory_offset_guard_size: u64

The size in bytes of the offset guard for static heaps.

dynamic_memory_offset_guard_size: u64

The size in bytes of the offset guard for dynamic heaps.

Implementations

impl BaseTunables[src]

pub fn for_target(target: &Target) -> Self[src]

Get the BaseTunables for a specific Target

Trait Implementations

impl Clone for BaseTunables[src]

impl Tunables for BaseTunables[src]

pub fn memory_style(&self, memory: &MemoryType) -> MemoryStyle[src]

Get a MemoryStyle for the provided MemoryType

pub fn table_style(&self, _table: &TableType) -> TableStyle[src]

Get a TableStyle for the provided TableType.

pub fn create_host_memory(
    &self,
    ty: &MemoryType,
    style: &MemoryStyle
) -> Result<Arc<dyn Memory>, MemoryError>
[src]

Create a memory owned by the host given a MemoryType and a MemoryStyle.

pub unsafe fn create_vm_memory(
    &self,
    ty: &MemoryType,
    style: &MemoryStyle,
    vm_definition_location: NonNull<VMMemoryDefinition>
) -> Result<Arc<dyn Memory>, MemoryError>
[src]

Create a memory owned by the VM given a MemoryType and a MemoryStyle.

Safety

  • vm_definition_location must point to a valid, owned VMMemoryDefinition, for example in VMContext.

pub fn create_host_table(
    &self,
    ty: &TableType,
    style: &TableStyle
) -> Result<Arc<dyn Table>, String>
[src]

Create a table owned by the host given a TableType and a TableStyle.

pub unsafe fn create_vm_table(
    &self,
    ty: &TableType,
    style: &TableStyle,
    vm_definition_location: NonNull<VMTableDefinition>
) -> Result<Arc<dyn Table>, String>
[src]

Create a table owned by the VM given a TableType and a TableStyle.

Safety

  • vm_definition_location must point to a valid, owned VMTableDefinition, for example in VMContext.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,