From 27f09564fd16376f5b050bacda7184519f4ba48a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 16 Aug 2024 17:45:53 -0600 Subject: [PATCH] add more pooling allocator options to CLI (#9138) This adds `pooling-table-elements` and `pooling-max-core-instance-size` options to the CLI, allowing the user to override the defaults. I found myself needing to override both of these settings when running a ASP.NET Core application built using the Native AOT feature of the .NET runtime. Signed-off-by: Joel Dice --- crates/cli-flags/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/cli-flags/src/lib.rs b/crates/cli-flags/src/lib.rs index f172d254115f..8a7bb6dc9b6b 100644 --- a/crates/cli-flags/src/lib.rs +++ b/crates/cli-flags/src/lib.rs @@ -115,6 +115,14 @@ wasmtime_option_group! { /// The maximum runtime size of each linear memory in the pooling /// allocator, in bytes. pub pooling_max_memory_size: Option, + + /// The maximum table elements for any table defined in a module when + /// using the pooling allocator. + pub pooling_table_elements: Option, + + /// The maximum size, in bytes, allocated for a core instance's metadata + /// when using the pooling allocator. + pub pooling_max_core_instance_size: Option, } enum Optimize { @@ -609,6 +617,12 @@ impl CommonOptions { if let Some(limit) = self.opts.pooling_total_tables { cfg.total_tables(limit); } + if let Some(limit) = self.opts.pooling_table_elements { + cfg.table_elements(limit); + } + if let Some(limit) = self.opts.pooling_max_core_instance_size { + cfg.max_core_instance_size(limit); + } match_feature! { ["async" : self.opts.pooling_total_stacks] limit => cfg.total_stacks(limit),