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

Function wasmtime_table_get

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

Source from the content-addressed store, hash-verified

151
152#[unsafe(no_mangle)]
153pub extern "C" fn wasmtime_table_get(
154 store: WasmtimeStoreContextMut<'_>,
155 table: &Table,
156 index: u64,
157 ret: &mut MaybeUninit<wasmtime_val_t>,
158) -> bool {
159 let mut store = store;
160
161 #[cfg(feature = "gc")]
162 let mut store = RootScope::new(&mut store);
163
164 match table.get(&mut store, index) {
165 Some(r) => {
166 crate::initialize(ret, wasmtime_val_t::from_val(&mut store, r.into()));
167 true
168 }
169 None => false,
170 }
171}
172
173#[unsafe(no_mangle)]
174pub unsafe extern "C" fn wasmtime_table_set(

Callers 3

mainFunction · 0.85
mainFunction · 0.85
getMethod · 0.85

Calls 3

initializeFunction · 0.70
newFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected