Skip to content

Commit

Permalink
add more pooling allocator options to CLI (bytecodealliance#9138)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dicej authored Aug 16, 2024
1 parent 69b005f commit 27f0956
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/cli-flags/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize>,

/// The maximum table elements for any table defined in a module when
/// using the pooling allocator.
pub pooling_table_elements: Option<u32>,

/// The maximum size, in bytes, allocated for a core instance's metadata
/// when using the pooling allocator.
pub pooling_max_core_instance_size: Option<usize>,
}

enum Optimize {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 27f0956

Please sign in to comment.