diff --git a/crates/cli-flags/src/lib.rs b/crates/cli-flags/src/lib.rs index 2b03d21b79e5..821636a53e93 100644 --- a/crates/cli-flags/src/lib.rs +++ b/crates/cli-flags/src/lib.rs @@ -81,6 +81,26 @@ wasmtime_option_group! { /// Configure attempting to initialize linear memory via a /// copy-on-write mapping (default: yes) pub memory_init_cow: Option, + + /// The maximum number of WebAssembly instances which can be created + /// with the pooling allocator. + pub pooling_total_core_instances: Option, + + /// The maximum number of WebAssembly components which can be created + /// with the pooling allocator. + pub pooling_total_component_instances: Option, + + /// The maximum number of WebAssembly memories which can be created with + /// the pooling allocator. + pub pooling_total_memories: Option, + + /// The maximum number of WebAssembly tables which can be created with + /// the pooling allocator. + pub pooling_total_tables: Option, + + /// The maximum number of WebAssembly stacks which can be created with + /// the pooling allocator. + pub pooling_total_stacks: Option, } enum Optimize { @@ -528,6 +548,21 @@ impl CommonOptions { if let Some(size) = self.opts.pooling_table_keep_resident { cfg.table_keep_resident(size); } + if let Some(limit) = self.opts.pooling_total_core_instances { + cfg.total_core_instances(limit); + } + if let Some(limit) = self.opts.pooling_total_component_instances { + cfg.total_component_instances(limit); + } + if let Some(limit) = self.opts.pooling_total_memories { + cfg.total_memories(limit); + } + if let Some(limit) = self.opts.pooling_total_tables { + cfg.total_tables(limit); + } + if let Some(limit) = self.opts.pooling_total_stacks { + cfg.total_stacks(limit); + } if let Some(enable) = self.opts.memory_protection_keys { if enable { cfg.memory_protection_keys(wasmtime::MpkEnabled::Enable);