(
store: &mut wasm_store_t,
gt: &wasm_globaltype_t,
val: &wasm_val_t,
)
| 33 | |
| 34 | #[unsafe(no_mangle)] |
| 35 | pub unsafe extern "C" fn wasm_global_new( |
| 36 | store: &mut wasm_store_t, |
| 37 | gt: &wasm_globaltype_t, |
| 38 | val: &wasm_val_t, |
| 39 | ) -> Option<Box<wasm_global_t>> { |
| 40 | match Global::new(store.store.context_mut(), gt.ty().ty.clone(), val.val()) { |
| 41 | Ok(global) => Some(Box::new(wasm_global_t { |
| 42 | ext: wasm_extern_t { |
| 43 | store: store.store.clone(), |
| 44 | which: global.into(), |
| 45 | }, |
| 46 | })), |
| 47 | Err(_) => None, |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | #[unsafe(no_mangle)] |
| 52 | pub extern "C" fn wasm_global_as_extern(g: &mut wasm_global_t) -> &mut wasm_extern_t { |
nothing calls this directly
no test coverage detected