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

Function wasmtime_table_set

crates/c-api/src/table.rs:174–190  ·  view source on GitHub ↗
(
    mut store: WasmtimeStoreContextMut<'_>,
    table: &Table,
    index: u64,
    val: &wasmtime_val_t,
)

Source from the content-addressed store, hash-verified

172
173#[unsafe(no_mangle)]
174pub unsafe extern "C" fn wasmtime_table_set(
175 mut store: WasmtimeStoreContextMut<'_>,
176 table: &Table,
177 index: u64,
178 val: &wasmtime_val_t,
179) -> Option<Box<wasmtime_error_t>> {
180 #[cfg(feature = "gc")]
181 let mut store = RootScope::new(&mut store);
182
183 handle_result(
184 val.to_val(&mut store)
185 .ref_()
186 .ok_or_else(|| format_err!("wasmtime_table_set value is not a reference"))
187 .and_then(|val| table.set(&mut store, index, val)),
188 |()| {},
189 )
190}
191
192#[unsafe(no_mangle)]
193pub extern "C" fn wasmtime_table_size(store: WasmtimeStoreContext<'_>, table: &Table) -> u64 {

Callers 3

mainFunction · 0.85
mainFunction · 0.85
setMethod · 0.85

Calls 5

handle_resultFunction · 0.85
ref_Method · 0.80
to_valMethod · 0.80
newFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected