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

Function wasm_engine_new

crates/c-api/src/engine.rs:13–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[unsafe(no_mangle)]
13pub extern "C" fn wasm_engine_new() -> Box<wasm_engine_t> {
14 // Enable the `env_logger` crate since this is as good a place as any to
15 // support some "top level initialization" for the C API. Almost all support
16 // should go through this one way or another, so this ensures that
17 // `RUST_LOG` should work reasonably well.
18 //
19 // Note that we `drop` the result here since this fails after the first
20 // initialization attempt. We don't mind that though because this function
21 // can be called multiple times, so we just ignore the result.
22 #[cfg(feature = "logging")]
23 drop(env_logger::try_init());
24
25 Box::new(wasm_engine_t {
26 engine: Engine::default(),
27 })
28}
29
30#[unsafe(no_mangle)]
31pub extern "C" fn wasm_engine_new_with_config(c: Box<wasm_config_t>) -> Box<wasm_engine_t> {

Callers 10

serializeFunction · 0.85
deserializeFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
EngineMethod · 0.85

Calls 2

dropFunction · 0.50
newFunction · 0.50

Tested by

no test coverage detected