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

Function wasm_module_new

crates/c-api/src/module.rs:34–42  ·  view source on GitHub ↗
(
    store: &mut wasm_store_t,
    binary: &wasm_byte_vec_t,
)

Source from the content-addressed store, hash-verified

32#[unsafe(no_mangle)]
33#[cfg(any(feature = "cranelift", feature = "winch"))]
34pub unsafe extern "C" fn wasm_module_new(
35 store: &mut wasm_store_t,
36 binary: &wasm_byte_vec_t,
37) -> Option<Box<wasm_module_t>> {
38 match Module::from_binary(store.store.context().engine(), binary.as_slice()) {
39 Ok(module) => Some(Box::new(wasm_module_t::new(module))),
40 Err(_) => None,
41 }
42}
43
44#[unsafe(no_mangle)]
45#[cfg(any(feature = "cranelift", feature = "winch"))]

Callers 2

mainFunction · 0.85
wasm.hFile · 0.85

Calls 4

newFunction · 0.50
engineMethod · 0.45
contextMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected