MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / wasmtime_table_new

Function wasmtime_table_new

crates/c-api/src/table.rs:126–142  ·  view source on GitHub ↗
(
    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)]
126pub 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)]
145pub unsafe extern "C" fn wasmtime_table_type(

Callers 1

createMethod · 0.85

Calls 6

handle_resultFunction · 0.85
ref_Method · 0.80
to_valMethod · 0.80
newFunction · 0.50
cloneMethod · 0.45
tyMethod · 0.45

Tested by

no test coverage detected