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

Function wasm_table_new

crates/c-api/src/table.rs:46–60  ·  view source on GitHub ↗
(
    store: &mut wasm_store_t,
    tt: &wasm_tabletype_t,
    init: Option<&wasm_ref_t>,
)

Source from the content-addressed store, hash-verified

44#[unsafe(no_mangle)]
45#[cfg(feature = "gc")]
46pub unsafe extern "C" fn wasm_table_new(
47 store: &mut wasm_store_t,
48 tt: &wasm_tabletype_t,
49 init: Option<&wasm_ref_t>,
50) -> Option<Box<wasm_table_t>> {
51 let tt = tt.ty().ty.clone();
52 let init = option_wasm_ref_t_to_ref(init, &tt);
53 let table = Table::new(store.store.context_mut(), tt, init).ok()?;
54 Some(Box::new(wasm_table_t {
55 ext: wasm_extern_t {
56 store: store.store.clone(),
57 which: table.into(),
58 },
59 }))
60}
61
62#[unsafe(no_mangle)]
63pub unsafe extern "C" fn wasm_table_type(t: &wasm_table_t) -> Box<wasm_tabletype_t> {

Callers

nothing calls this directly

Calls 6

option_wasm_ref_t_to_refFunction · 0.85
context_mutMethod · 0.80
newFunction · 0.50
cloneMethod · 0.45
tyMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected