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

Function wasmtime_func_new_unchecked

crates/c-api/src/func.rs:312–323  ·  view source on GitHub ↗
(
    store: WasmtimeStoreContextMut<'_>,
    ty: &wasm_functype_t,
    callback: wasmtime_func_unchecked_callback_t,
    data: *mut c_void,
    finalizer: Option<extern "C" fn(*mut std::ffi::c_void)>

Source from the content-addressed store, hash-verified

310
311#[unsafe(no_mangle)]
312pub unsafe extern "C" fn wasmtime_func_new_unchecked(
313 store: WasmtimeStoreContextMut<'_>,
314 ty: &wasm_functype_t,
315 callback: wasmtime_func_unchecked_callback_t,
316 data: *mut c_void,
317 finalizer: Option<extern "C" fn(*mut std::ffi::c_void)>,
318 func: &mut Func,
319) {
320 let ty = ty.ty().ty(store.engine());
321 let cb = c_unchecked_callback_to_rust_fn(callback, data, finalizer);
322 *func = Func::new_unchecked(store, ty, cb);
323}
324
325pub(crate) unsafe fn c_unchecked_callback_to_rust_fn(
326 callback: wasmtime_func_unchecked_callback_t,

Callers 1

wrapMethod · 0.85

Calls 3

tyMethod · 0.45
engineMethod · 0.45

Tested by

no test coverage detected