(
&self,
store: &'a StoreOpaque,
options: OptionsIndex,
)
| 477 | } |
| 478 | |
| 479 | pub(crate) fn options_memory<'a>( |
| 480 | &self, |
| 481 | store: &'a StoreOpaque, |
| 482 | options: OptionsIndex, |
| 483 | ) -> &'a [u8] { |
| 484 | let memory = match self.options_memory_raw(store, options) { |
| 485 | Some(m) => m, |
| 486 | None => return &[], |
| 487 | }; |
| 488 | // SAFETY: we're borrowing the entire `StoreOpaque` which owns the |
| 489 | // memory allocation to return the result of memory. That means that the |
| 490 | // lifetime connection here should be safe and the actual ptr/length are |
| 491 | // trusted parts of the runtime here. |
| 492 | unsafe { |
| 493 | let memory = memory.as_ref(); |
| 494 | core::slice::from_raw_parts(memory.base.as_ptr(), memory.current_length()) |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | pub(crate) fn options_memory_mut<'a>( |
| 499 | &self, |
no test coverage detected