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

Method get_memory

crates/wasmtime/src/runtime/vm/instance.rs:469–476  ·  view source on GitHub ↗
(&self, index: MemoryIndex)

Source from the content-addressed store, hash-verified

467 /// Get a locally defined or imported memory.
468 #[cfg(all(has_host_compiler_backend, feature = "debug-builtins"))]
469 pub(crate) fn get_memory(&self, index: MemoryIndex) -> VMMemoryDefinition {
470 if let Some(defined_index) = self.env_module().defined_memory_index(index) {
471 self.memory(defined_index)
472 } else {
473 let import = self.imported_memory(index);
474 unsafe { VMMemoryDefinition::load(import.from.as_ptr()) }
475 }
476 }
477
478 /// Return the indexed `VMMemoryDefinition`, loaded from vmctx memory
479 /// already.

Callers 2

resolve_vmctx_memory_ptrFunction · 0.45

Calls 6

defined_memory_indexMethod · 0.80
imported_memoryMethod · 0.80
loadFunction · 0.50
env_moduleMethod · 0.45
memoryMethod · 0.45
as_ptrMethod · 0.45

Tested by

no test coverage detected