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

Function module

benches/trap.rs:215–227  ·  view source on GitHub ↗
(engine: &Engine, num_funcs: u64)

Source from the content-addressed store, hash-verified

213}
214
215fn module(engine: &Engine, num_funcs: u64) -> Result<Module> {
216 let mut wat = String::new();
217 wat.push_str("(module\n");
218 for i in 0..num_funcs {
219 let j = i + 1;
220 wat.push_str(&format!("(func $f{i} call $f{j})\n"));
221 }
222 wat.push_str(&format!("(func $f{num_funcs} unreachable)\n"));
223 wat.push_str(&format!("(export \"\" (func $f0))\n"));
224 wat.push_str(")\n");
225
226 Module::new(engine, &wat)
227}

Calls 2

newFunction · 0.50
push_strMethod · 0.45

Tested by

no test coverage detected