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

Function functions_interruptible

tests/all/iloop.rs:42–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41#[test]
42fn functions_interruptible() -> wasmtime::Result<()> {
43 let mut store = interruptible_store();
44 let module = hugely_recursive_module(store.engine())?;
45 let func = Func::wrap(&mut store, || {});
46 let instance = Instance::new(&mut store, &module, &[func.into()])?;
47 let iloop = instance.get_typed_func::<(), ()>(&mut store, "loop")?;
48 store.engine().increment_epoch();
49 let trap = iloop.call(&mut store, ()).unwrap_err().downcast::<Trap>()?;
50 assert_eq!(trap, Trap::Interrupt);
51 Ok(())
52}
53
54const NUM_HITS: usize = 100_000;
55

Callers

nothing calls this directly

Calls 7

interruptible_storeFunction · 0.85
hugely_recursive_moduleFunction · 0.85
OkFunction · 0.85
newFunction · 0.50
engineMethod · 0.45
increment_epochMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected