Struct wasmtime_runtime::ModuleMemoryImages
source · pub struct ModuleMemoryImages { /* private fields */ }
Expand description
Backing images for memories in a module.
This is meant to be built once, when a module is first loaded/constructed, and then used many times for instantiation.
Implementations§
source§impl ModuleMemoryImages
impl ModuleMemoryImages
sourcepub fn get_memory_image(
&self,
defined_index: DefinedMemoryIndex
) -> Option<&Arc<MemoryImage>>
pub fn get_memory_image( &self, defined_index: DefinedMemoryIndex ) -> Option<&Arc<MemoryImage>>
Get the MemoryImage for a given memory.
source§impl ModuleMemoryImages
impl ModuleMemoryImages
sourcepub fn new(
module: &Module,
wasm_data: &[u8],
mmap: Option<&MmapVec>
) -> Result<Option<ModuleMemoryImages>>
pub fn new( module: &Module, wasm_data: &[u8], mmap: Option<&MmapVec> ) -> Result<Option<ModuleMemoryImages>>
Create a new ModuleMemoryImages
for the given module. This can be
passed in as part of a InstanceAllocationRequest
to speed up
instantiation and execution by using copy-on-write-backed memories.