wasmtime_environ

Struct Tunables

Source
pub struct Tunables {
Show 16 fields pub collector: Option<Collector>, pub static_memory_reservation: u64, pub memory_guard_size: u64, pub dynamic_memory_growth_reserve: u64, pub generate_native_debuginfo: bool, pub parse_wasm_debuginfo: bool, pub consume_fuel: bool, pub epoch_interruption: bool, pub static_memory_bound_is_maximum: bool, pub guard_before_linear_memory: bool, pub table_lazy_init: bool, pub generate_address_map: bool, pub debug_adapter_modules: bool, pub relaxed_simd_deterministic: bool, pub winch_callable: bool, pub signals_based_traps: bool,
}
Expand description

Tunable parameters for WebAssembly compilation.

Fields§

§collector: Option<Collector>

The garbage collector implementation to use, which implies the layout of GC objects and barriers that must be emitted in Wasm code.

§static_memory_reservation: u64

For static heaps, the size in bytes of virtual memory reservation for the heap.

§memory_guard_size: u64

The size, in bytes, of the guard page region for linear memories.

§dynamic_memory_growth_reserve: u64

The size, in bytes, of reserved memory at the end of a “dynamic” memory, before the guard page, that memory can grow into. This is intended to amortize the cost of memory.grow in the same manner that Vec<T> has space not in use to grow into.

§generate_native_debuginfo: bool

Whether or not to generate native DWARF debug information.

§parse_wasm_debuginfo: bool

Whether or not to retain DWARF sections in compiled modules.

§consume_fuel: bool

Whether or not fuel is enabled for generated code, meaning that fuel will be consumed every time a wasm instruction is executed.

§epoch_interruption: bool

Whether or not we use epoch-based interruption.

§static_memory_bound_is_maximum: bool

Whether or not to treat the static memory bound as the maximum for unbounded heaps.

§guard_before_linear_memory: bool

Whether or not linear memory allocations will have a guard region at the beginning of the allocation in addition to the end.

§table_lazy_init: bool

Whether to initialize tables lazily, so that instantiation is fast but indirect calls are a little slower. If false, tables are initialized eagerly from any active element segments that apply to them during instantiation.

§generate_address_map: bool

Indicates whether an address map from compiled native code back to wasm offsets in the original file is generated.

§debug_adapter_modules: bool

Flag for the component module whether adapter modules have debug assertions baked into them.

§relaxed_simd_deterministic: bool

Whether or not lowerings for relaxed simd instructions are forced to be deterministic.

§winch_callable: bool

Whether or not Wasm functions target the winch abi.

§signals_based_traps: bool

Whether or not the host will be using native signals (e.g. SIGILL, SIGSEGV, etc) to implement traps.

Implementations§

Source§

impl Tunables

Source

pub fn default_host() -> Self

Returns a Tunables configuration assumed for running code on the host.

Source

pub fn default_for_target(target: &Triple) -> Result<Self>

Returns the default set of tunables for the given target triple.

Source

pub fn default_miri() -> Tunables

Returns the default set of tunables for running under MIRI.

Source

pub fn default_u32() -> Tunables

Returns the default set of tunables for running under a 32-bit host.

Source

pub fn default_u64() -> Tunables

Returns the default set of tunables for running under a 64-bit host.

Trait Implementations§

Source§

impl Clone for Tunables

Source§

fn clone(&self) -> Tunables

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tunables

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Tunables

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Tunables

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Serialize for Tunables

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,