(&'a self, vmctx: NonNull<VMContext>)
| 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 | /// |
no test coverage detected