(&self, store: &mut StoreContextMut<'_, T>)
| 357 | } |
| 358 | |
| 359 | fn start_raw<T>(&self, store: &mut StoreContextMut<'_, T>) -> Result<()> { |
| 360 | // If a start function is present, invoke it. Make sure we use all the |
| 361 | // trap-handling configuration in `store` as well. |
| 362 | let store_id = store.0.id(); |
| 363 | let (mut instance, registry) = self.id.get_mut_and_module_registry(store.0); |
| 364 | // SAFETY: the `store_id` is the id of the store that owns this |
| 365 | // instance and any function stored within the instance. |
| 366 | let f = unsafe { |
| 367 | instance |
| 368 | .as_mut() |
| 369 | .get_startup_func(registry, store_id) |
| 370 | .expect("should have a startup function") |
| 371 | }; |
| 372 | let caller_vmctx = instance.vmctx(); |
| 373 | unsafe { |
| 374 | let funcref = f.vm_func_ref(store.0); |
| 375 | super::func::invoke_wasm_and_catch_traps(store, |_default_caller, vm| { |
| 376 | VMFuncRef::array_call(funcref, vm, caller_vmctx, NonNull::from(&mut [])) |
| 377 | })?; |
| 378 | } |
| 379 | Ok(()) |
| 380 | } |
| 381 | |
| 382 | /// Get this instance's module. |
| 383 | pub fn module<'a, T: 'static>(&self, store: impl Into<StoreContext<'a, T>>) -> &'a Module { |
no test coverage detected