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

Method defined_memory_index

crates/environ/src/module.rs:394–402  ·  view source on GitHub ↗
(&self, memory: MemoryIndex)

Source from the content-addressed store, hash-verified

392 /// index is an imported memory.
393 #[inline]
394 pub fn defined_memory_index(&self, memory: MemoryIndex) -> Option<DefinedMemoryIndex> {
395 if memory.index() < self.num_imported_memories {
396 None
397 } else {
398 Some(DefinedMemoryIndex::new(
399 memory.index() - self.num_imported_memories,
400 ))
401 }
402 }
403
404 /// Convert a `DefinedMemoryIndex` into an `OwnedMemoryIndex`. Returns None
405 /// if the index is an imported memory.

Callers 12

resolve_heapMethod · 0.80
memory_alias_regionMethod · 0.80
make_heapMethod · 0.80
memory_size_in_bytesMethod · 0.80
get_memoryMethod · 0.80
get_exported_memoryMethod · 0.80
initialize_vmctxMethod · 0.80
newMethod · 0.80
allocate_memoriesMethod · 0.80
try_static_initMethod · 0.80

Calls 2

newFunction · 0.50
indexMethod · 0.45

Tested by

no test coverage detected