InstanceAllocationStrategy in wasmtime - Rust (original) (raw)
Enum InstanceAllocationStrategy
#[non_exhaustive]
pub enum InstanceAllocationStrategy {
OnDemand,
Pooling(PoolingAllocationConfig),
}
Expand description
Represents the module instance allocation strategy to use.
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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.
Available on crate feature 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.
Available on crate feature pooling-allocator
only.
The default pooling instance allocation strategy.