From 4fef150816049518208ed36c8ed4a7d1cf67e102 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 2 May 2024 11:22:20 -0700 Subject: [PATCH] Double the default allowed table elements (#8527) * Double the default allowed table elements This commit doubles the default allowed table elements per table in the pooling allocator from 10k to 20k. This helps to, by default, run the module produced in #8504. * Update docs on deafults --- crates/wasmtime/src/config.rs | 2 +- crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index 1e6a498357..e29d291cd8 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -2645,7 +2645,7 @@ impl PoolingAllocationConfig { } /// The maximum table elements for any table defined in a module (default is - /// `10000`). + /// `20000`). /// /// If a table's minimum element limit is greater than this value, the /// module will fail to instantiate. diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs index 9af809e6bc..6809da8d79 100644 --- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs +++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs @@ -156,7 +156,9 @@ impl Default for InstanceLimits { total_stacks: 1000, core_instance_size: 1 << 20, // 1 MiB max_tables_per_module: 1, - table_elements: 10_000, + // NB: in #8504 it was seen that a C# module in debug module can + // have 10k+ elements. + table_elements: 20_000, max_memories_per_module: 1, memory_pages: 160, #[cfg(feature = "gc")]