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

Function async_with_pooling_stacks

tests/all/async_functions.rs:350–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

348
349#[tokio::test]
350async fn async_with_pooling_stacks() {
351 let mut pool = crate::small_pool_config();
352 pool.total_stacks(1)
353 .max_memory_size(1 << 16)
354 .table_elements(0);
355 let mut config = Config::new();
356 config.allocation_strategy(InstanceAllocationStrategy::Pooling(pool));
357 config.memory_guard_size(0);
358 config.memory_reservation(1 << 16);
359
360 let engine = Engine::new(&config).unwrap();
361 let mut store = Store::new(&engine, ());
362 let func_ty = FuncType::new(store.engine(), None, None);
363 let func = Func::new_async(&mut store, func_ty, move |_caller, _params, _results| {
364 Box::new(async { Ok(()) })
365 });
366
367 run_smoke_test(&mut store, func).await;
368 run_smoke_typed_test(&mut store, func).await;
369}
370
371#[tokio::test]
372async fn async_host_func_with_pooling_stacks() -> Result<()> {

Callers

nothing calls this directly

Calls 13

OkFunction · 0.85
run_smoke_testFunction · 0.85
run_smoke_typed_testFunction · 0.85
allocation_strategyMethod · 0.80
small_pool_configFunction · 0.70
newFunction · 0.50
table_elementsMethod · 0.45
max_memory_sizeMethod · 0.45
total_stacksMethod · 0.45
memory_guard_sizeMethod · 0.45
memory_reservationMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected