(mut self: Pin<&mut Self>, store: &StoreOpaque)
| 555 | } |
| 556 | |
| 557 | pub(crate) unsafe fn set_store(mut self: Pin<&mut Self>, store: &StoreOpaque) { |
| 558 | // FIXME: should be more targeted ideally with the `unsafe` than just |
| 559 | // throwing this entire function in a large `unsafe` block. |
| 560 | unsafe { |
| 561 | *self.as_mut().store_mut() = Some(VMStoreRawPtr(store.traitobj())); |
| 562 | self.vm_store_context() |
| 563 | .write(Some(store.vm_store_context_ptr().into())); |
| 564 | #[cfg(target_has_atomic = "64")] |
| 565 | { |
| 566 | *self.as_mut().epoch_ptr() = |
| 567 | Some(NonNull::from(store.engine().epoch_counter()).into()); |
| 568 | } |
| 569 | |
| 570 | if self.env_module().needs_gc_heap { |
| 571 | self.as_mut().set_gc_heap(Some(store.unwrap_gc_store())); |
| 572 | } else { |
| 573 | self.as_mut().set_gc_heap(None); |
| 574 | } |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | unsafe fn set_gc_heap(self: Pin<&mut Self>, gc_store: Option<&GcStore>) { |
| 579 | if let Some(gc_store) = gc_store { |
no test coverage detected