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

Function wasmtime_arrayref_len

crates/c-api/src/arrayref.rs:72–87  ·  view source on GitHub ↗
(
    cx: WasmtimeStoreContextMut<'_>,
    arrayref: Option<&wasmtime_arrayref_t>,
    out: &mut MaybeUninit<u32>,
)

Source from the content-addressed store, hash-verified

70
71#[unsafe(no_mangle)]
72pub unsafe extern "C" fn wasmtime_arrayref_len(
73 cx: WasmtimeStoreContextMut<'_>,
74 arrayref: Option<&wasmtime_arrayref_t>,
75 out: &mut MaybeUninit<u32>,
76) -> Option<Box<crate::wasmtime_error_t>> {
77 let arrayref = arrayref
78 .and_then(|a| a.as_wasmtime())
79 .expect("non-null arrayref required");
80 match arrayref.len(&cx) {
81 Ok(len) => {
82 crate::initialize(out, len);
83 None
84 }
85 Err(e) => Some(Box::new(e.into())),
86 }
87}
88
89#[unsafe(no_mangle)]
90pub unsafe extern "C" fn wasmtime_arrayref_get(

Callers 1

lenMethod · 0.85

Calls 5

as_wasmtimeMethod · 0.80
initializeFunction · 0.70
newFunction · 0.50
expectMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected