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

Method debug_shared_memory

crates/wasmtime/src/runtime/debug.rs:250–260  ·  view source on GitHub ↗

Get access to a shared memory within this instance's memory index space. This permits accessing memories whether they are exported or not. However, it is only available for purposes of debugging, and so is only permitted when `guest_debug` is enabled in the Engine's configuration. The intent of the Wasmtime API is to enforce the Wasm type system's encapsulation even in the host API, except where

(
        &self,
        mut store: impl AsContextMut,
        memory_index: u32,
    )

Source from the content-addressed store, hash-verified

248 /// `None` is returned if guest-debugging is not enabled in the
249 /// engine configuration for this Store.
250 pub fn debug_shared_memory(
251 &self,
252 mut store: impl AsContextMut,
253 memory_index: u32,
254 ) -> Option<crate::SharedMemory> {
255 self.debug_export(
256 store.as_context_mut().0,
257 MemoryIndex::from_bits(memory_index).into(),
258 )
259 .and_then(|s| s.into_shared_memory())
260 }
261
262 /// Get access to a table within this instance's table index
263 /// space.

Callers 1

Calls 3

debug_exportMethod · 0.80
into_shared_memoryMethod · 0.80
as_context_mutMethod · 0.45

Tested by

no test coverage detected