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

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§

Get the BaseTunables for a specific Target

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Get a MemoryStyle for the provided MemoryType

Get a TableStyle for the provided TableType.

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

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.

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

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.
Create a global with an unset value.
Allocate memory for just the memories of the current module. Read more
Allocate memory for just the tables of the current module. Read more
Allocate memory for just the globals of the current module, with initializers applied.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type for metadata in pointers and references to Self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.