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

Function wasmtime_anyref_from_i31

crates/c-api/src/anyref.rs:146–155  ·  view source on GitHub ↗
(
    cx: WasmtimeStoreContextMut<'_>,
    val: u32,
    out: &mut MaybeUninit<wasmtime_anyref_t>,
)

Source from the content-addressed store, hash-verified

144
145#[unsafe(no_mangle)]
146pub extern "C" fn wasmtime_anyref_from_i31(
147 cx: WasmtimeStoreContextMut<'_>,
148 val: u32,
149 out: &mut MaybeUninit<wasmtime_anyref_t>,
150) {
151 let mut scope = RootScope::new(cx);
152 let anyref = AnyRef::from_i31(&mut scope, I31::wrapping_u32(val));
153 let anyref = anyref.to_owned_rooted(&mut scope).expect("in scope");
154 crate::initialize(out, Some(anyref).into())
155}
156
157#[unsafe(no_mangle)]
158pub unsafe extern "C" fn wasmtime_anyref_is_i31(

Callers 2

mainFunction · 0.85
i31Method · 0.85

Calls 4

initializeFunction · 0.70
newFunction · 0.50
expectMethod · 0.45
to_owned_rootedMethod · 0.45

Tested by

no test coverage detected