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

Function wasm_module_obtain

crates/c-api/src/module.rs:98–108  ·  view source on GitHub ↗
(
    store: &mut wasm_store_t,
    shared_module: &wasm_shared_module_t,
)

Source from the content-addressed store, hash-verified

96
97#[unsafe(no_mangle)]
98pub unsafe extern "C" fn wasm_module_obtain(
99 store: &mut wasm_store_t,
100 shared_module: &wasm_shared_module_t,
101) -> Option<Box<wasm_module_t>> {
102 let module = shared_module.module.clone();
103 if Engine::same(store.store.context().engine(), module.engine()) {
104 Some(Box::new(wasm_module_t::new(module)))
105 } else {
106 None
107 }
108}
109
110#[unsafe(no_mangle)]
111#[cfg(any(feature = "cranelift", feature = "winch"))]

Callers 1

runFunction · 0.85

Calls 4

newFunction · 0.50
cloneMethod · 0.45
engineMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected