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

Function wasmtime_module_new

crates/c-api/src/module.rs:138–150  ·  view source on GitHub ↗
(
    engine: &wasm_engine_t,
    wasm: *const u8,
    len: usize,
    out: &mut *mut wasmtime_module_t,
)

Source from the content-addressed store, hash-verified

136#[unsafe(no_mangle)]
137#[cfg(any(feature = "cranelift", feature = "winch"))]
138pub unsafe extern "C" fn wasmtime_module_new(
139 engine: &wasm_engine_t,
140 wasm: *const u8,
141 len: usize,
142 out: &mut *mut wasmtime_module_t,
143) -> Option<Box<wasmtime_error_t>> {
144 handle_result(
145 Module::from_binary(&engine.engine, crate::slice_from_raw_parts(wasm, len)),
146 |module| {
147 *out = Box::into_raw(Box::new(wasmtime_module_t { module }));
148 },
149 )
150}
151
152#[unsafe(no_mangle)]
153pub extern "C" fn wasmtime_module_clone(module: &wasmtime_module_t) -> Box<wasmtime_module_t> {

Callers 15

mainFunction · 0.85
mainFunction · 0.85
serializeFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

handle_resultFunction · 0.85
slice_from_raw_partsFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected