pub enum MemoryBackend {
UnifiedBuffer,
PoolingMpk {
max_memories: u32,
memory_bytes: usize,
},
}Expand description
Selects the linear-memory backing strategy for the engine.
The two modes are mutually exclusive at the Wasmtime level:
with_host_memory (used by MemoryBackend::UnifiedBuffer) cannot coexist
with the pooling allocator (required by MemoryBackend::PoolingMpk).
Operators pick the mode that fits their workload.
Variants§
UnifiedBuffer
Host-provided UnifiedBuffer-backed linear memory via with_host_memory.
Required for the GPU integration path (kernels read/write the same
allocation the Wasm guest sees). DOES NOT support MPK — Wasmtime’s
pooling+MPK machinery is mutually exclusive with custom MemoryCreator.
PoolingMpk
Wasmtime’s pooling allocator with MPK (memory protection keys). Trades the GPU integration path for intra-process Wasm isolation via CPU PKU. Suitable for CPU-only or batch-GPU workloads where kernel launches don’t share memory with Wasm at byte level.
Trait Implementations§
Source§impl Clone for MemoryBackend
impl Clone for MemoryBackend
Source§fn clone(&self) -> MemoryBackend
fn clone(&self) -> MemoryBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryBackend
impl Debug for MemoryBackend
Source§impl Default for MemoryBackend
impl Default for MemoryBackend
Source§fn default() -> MemoryBackend
fn default() -> MemoryBackend
Auto Trait Implementations§
impl Freeze for MemoryBackend
impl RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnsafeUnpin for MemoryBackend
impl UnwindSafe for MemoryBackend
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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