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

Function wasmtime_linker_define

crates/c-api/src/linker.rs:53–67  ·  view source on GitHub ↗
(
    linker: &mut wasmtime_linker_t,
    store: WasmtimeStoreContext<'_>,
    module: *const u8,
    module_len: usize,
    name: *const u8,
    name_len: usize,
    item: &wasmtime_extern_t,
)

Source from the content-addressed store, hash-verified

51
52#[unsafe(no_mangle)]
53pub unsafe extern "C" fn wasmtime_linker_define(
54 linker: &mut wasmtime_linker_t,
55 store: WasmtimeStoreContext<'_>,
56 module: *const u8,
57 module_len: usize,
58 name: *const u8,
59 name_len: usize,
60 item: &wasmtime_extern_t,
61) -> Option<Box<wasmtime_error_t>> {
62 let linker = &mut linker.linker;
63 let module = to_str!(module, module_len);
64 let name = to_str!(name, name_len);
65 let item = item.to_extern();
66 handle_result(linker.define(&store, module, name, item), |_linker| ())
67}
68
69#[unsafe(no_mangle)]
70pub unsafe extern "C" fn wasmtime_linker_define_func(

Callers 1

defineMethod · 0.85

Calls 3

handle_resultFunction · 0.85
to_externMethod · 0.45
defineMethod · 0.45

Tested by

no test coverage detected