(
state: *mut c_void,
wasm_bytes: *const u8,
wasm_bytes_length: usize,
)
| 382 | /// Compile the Wasm benchmark module. |
| 383 | #[unsafe(no_mangle)] |
| 384 | pub 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)] |
nothing calls this directly
no test coverage detected