MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / extract_memory

Method extract_memory

crates/wasmtime/src/runtime/component/instance.rs:903–911  ·  view source on GitHub ↗
(&mut self, store: &mut StoreOpaque, memory: &ExtractMemory)

Source from the content-addressed store, hash-verified

901 }
902
903 fn extract_memory(&mut self, store: &mut StoreOpaque, memory: &ExtractMemory) {
904 let import = match lookup_vmexport(store, self.id, &memory.export) {
905 crate::runtime::vm::Export::Memory(memory) => memory.vmimport(store),
906 crate::runtime::vm::Export::SharedMemory(_, import) => import,
907 _ => unreachable!(),
908 };
909 self.instance_mut(store)
910 .set_runtime_memory(memory.index, import.from.as_non_null());
911 }
912
913 fn extract_realloc(&mut self, store: &mut StoreOpaque, realloc: &ExtractRealloc) {
914 let func_ref = match lookup_vmdef(store, self.id, &realloc.def) {

Callers 1

runMethod · 0.80

Calls 5

lookup_vmexportFunction · 0.85
set_runtime_memoryMethod · 0.80
vmimportMethod · 0.45
instance_mutMethod · 0.45
as_non_nullMethod · 0.45

Tested by

no test coverage detected