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

Method sibling_vmctx

crates/wasmtime/src/runtime/vm/instance.rs:354–363  ·  view source on GitHub ↗
(&'a self, vmctx: NonNull<VMContext>)

Source from the content-addressed store, hash-verified

352 /// from the store that `self` belongs to.
353 #[inline]
354 unsafe fn sibling_vmctx<'a>(&'a self, vmctx: NonNull<VMContext>) -> &'a Instance {
355 // SAFETY: it's a contract of this function itself that `vmctx` is a
356 // valid pointer. Additionally with `self` being a
357 let ptr = unsafe { Instance::from_vmctx(vmctx) };
358 // SAFETY: it's a contract of this function itself that `vmctx` is a
359 // valid pointer to dereference. Additionally the lifetime of the return
360 // value is constrained to be the same as `self` to avoid granting a
361 // too-long lifetime.
362 unsafe { ptr.as_ref() }
363 }
364
365 /// Same as [`Self::sibling_vmctx`], but the mutable version.
366 ///

Callers 4

get_exported_tableMethod · 0.80
get_exported_memoryMethod · 0.80
get_exported_globalMethod · 0.80
get_exported_tagMethod · 0.80

Calls 1

as_refMethod · 0.45

Tested by

no test coverage detected