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

Function engine

tests/all/threads.rs:10–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8use wasmtime::*;
9
10pub fn engine() -> Option<Engine> {
11 let mut config = Config::new();
12 config.wasm_threads(true);
13 config.shared_memory(true);
14 match Engine::new(&config) {
15 Ok(engine) => {
16 assert!(cfg!(target_pointer_width = "64"));
17 Some(engine)
18 }
19 Err(e) => {
20 assert!(cfg!(target_pointer_width = "32"), "unexpected error {e:?}");
21 None
22 }
23 }
24}
25
26#[test]
27#[cfg_attr(miri, ignore)]

Calls 3

newFunction · 0.50
wasm_threadsMethod · 0.45
shared_memoryMethod · 0.45