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

Function wasm_bench_compile

crates/bench-api/src/lib.rs:384–393  ·  view source on GitHub ↗
(
    state: *mut c_void,
    wasm_bytes: *const u8,
    wasm_bytes_length: usize,
)

Source from the content-addressed store, hash-verified

382/// Compile the Wasm benchmark module.
383#[unsafe(no_mangle)]
384pub extern "C" fn wasm_bench_compile(
385 state: *mut c_void,
386 wasm_bytes: *const u8,
387 wasm_bytes_length: usize,
388) -> ExitCode {
389 let state = unsafe { (state as *mut BenchState).as_mut().unwrap() };
390 let wasm_bytes = unsafe { slice::from_raw_parts(wasm_bytes, wasm_bytes_length) };
391 let result = state.compile(wasm_bytes).context("failed to compile");
392 to_exit_code(result)
393}
394
395/// Instantiate the Wasm benchmark module.
396#[unsafe(no_mangle)]

Callers

nothing calls this directly

Calls 5

to_exit_codeFunction · 0.85
unwrapMethod · 0.45
as_mutMethod · 0.45
contextMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected