Function
wasmtime_global_new
(
mut store: WasmtimeStoreContextMut<'_>,
gt: &wasm_globaltype_t,
val: &wasmtime_val_t,
ret: &mut Global,
)
Source from the content-addressed store, hash-verified
| 81 | |
| 82 | #[unsafe(no_mangle)] |
| 83 | pub unsafe extern "C" fn wasmtime_global_new( |
| 84 | mut store: WasmtimeStoreContextMut<'_>, |
| 85 | gt: &wasm_globaltype_t, |
| 86 | val: &wasmtime_val_t, |
| 87 | ret: &mut Global, |
| 88 | ) -> Option<Box<wasmtime_error_t>> { |
| 89 | #[cfg(feature = "gc")] |
| 90 | let mut store = RootScope::new(&mut store); |
| 91 | |
| 92 | let val = val.to_val(&mut store); |
| 93 | let global = Global::new(&mut store, gt.ty().ty.clone(), val); |
| 94 | handle_result(global, |global| { |
| 95 | *ret = global; |
| 96 | }) |
| 97 | } |
| 98 | |
| 99 | #[unsafe(no_mangle)] |
| 100 | pub extern "C" fn wasmtime_global_type( |
Tested by
no test coverage detected