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

Function table_new

crates/fuzzing/tests/oom/table.rs:7–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6#[test]
7fn table_new() -> Result<()> {
8 let mut config = Config::new();
9 config.enable_compiler(false);
10 config.concurrency_support(false);
11 let engine = Engine::new(&config)?;
12
13 OomTest::new()
14 // `IndexMap::reserve` will try to allocate double space, but if that
15 // fails, will attempt to allocate the minimal space necessary.
16 .allow_alloc_after_oom(true)
17 .test(|| {
18 let mut store = Store::try_new(&engine, ())?;
19 let ty = TableType::new(RefType::FUNCREF, 1, None);
20 let _table = wasmtime::Table::new(&mut store, ty, Ref::Func(None))?;
21 Ok(())
22 })
23}
24
25#[tokio::test]
26async fn table_new_async() -> Result<()> {

Callers

nothing calls this directly

Calls 8

OkFunction · 0.85
enable_compilerMethod · 0.80
allow_alloc_after_oomMethod · 0.80
newFunction · 0.50
try_newFunction · 0.50
FuncClass · 0.50
concurrency_supportMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected