#[non_exhaustive]pub enum InstanceAllocationStrategy {
OnDemand,
Pooling(PoolingAllocationConfig),
}Expand description
Represents the module instance allocation strategy to use.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OnDemand
The on-demand instance allocation strategy.
Resources related to a module instance are allocated at instantiation time and
immediately deallocated when the Store referencing the instance is dropped.
This is the default allocation strategy for Wasmtime.
Pooling(PoolingAllocationConfig)
pooling-allocator only.The pooling instance allocation strategy.
A pool of resources is created in advance and module instantiation reuses resources
from the pool. Resources are returned to the pool when the Store referencing the instance
is dropped.
When GC is enabled, the pooling allocator requires that the GC heap
configuration matches the linear memory configuration (i.e.,
gc_heap_reservation must equal memory_reservation, etc.). By
default, if no gc_heap_* tunables are explicitly configured, they
automatically inherit the memory_* values.
Implementations§
Trait Implementations§
Source§impl Clone for InstanceAllocationStrategy
impl Clone for InstanceAllocationStrategy
Source§fn clone(&self) -> InstanceAllocationStrategy
fn clone(&self) -> InstanceAllocationStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for InstanceAllocationStrategy
impl Default for InstanceAllocationStrategy
Source§impl From<PoolingAllocationConfig> for InstanceAllocationStrategy
Available on crate feature pooling-allocator only.
impl From<PoolingAllocationConfig> for InstanceAllocationStrategy
pooling-allocator only.Source§fn from(cfg: PoolingAllocationConfig) -> InstanceAllocationStrategy
fn from(cfg: PoolingAllocationConfig) -> InstanceAllocationStrategy
Auto Trait Implementations§
impl Freeze for InstanceAllocationStrategy
impl RefUnwindSafe for InstanceAllocationStrategy
impl Send for InstanceAllocationStrategy
impl Sync for InstanceAllocationStrategy
impl Unpin for InstanceAllocationStrategy
impl UnsafeUnpin for InstanceAllocationStrategy
impl UnwindSafe for InstanceAllocationStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more