Function
wasmtime_table_new
(
mut store: WasmtimeStoreContextMut<'_>,
tt: &wasm_tabletype_t,
init: &wasmtime_val_t,
out: &mut Table,
)
Source from the content-addressed store, hash-verified
| 124 | |
| 125 | #[unsafe(no_mangle)] |
| 126 | pub unsafe extern "C" fn wasmtime_table_new( |
| 127 | mut store: WasmtimeStoreContextMut<'_>, |
| 128 | tt: &wasm_tabletype_t, |
| 129 | init: &wasmtime_val_t, |
| 130 | out: &mut Table, |
| 131 | ) -> Option<Box<wasmtime_error_t>> { |
| 132 | #[cfg(feature = "gc")] |
| 133 | let mut store = RootScope::new(&mut store); |
| 134 | |
| 135 | handle_result( |
| 136 | init.to_val(&mut store) |
| 137 | .ref_() |
| 138 | .ok_or_else(|| format_err!("wasmtime_table_new init value is not a reference")) |
| 139 | .and_then(|init| Table::new(&mut store, tt.ty().ty.clone(), init)), |
| 140 | |table| *out = table, |
| 141 | ) |
| 142 | } |
| 143 | |
| 144 | #[unsafe(no_mangle)] |
| 145 | pub unsafe extern "C" fn wasmtime_table_type( |
Tested by
no test coverage detected