diff --git a/crates/cli-flags/src/lib.rs b/crates/cli-flags/src/lib.rs index 3488096acefd..cb9f0ef82d15 100644 --- a/crates/cli-flags/src/lib.rs +++ b/crates/cli-flags/src/lib.rs @@ -196,6 +196,11 @@ pub struct CommonOptions { #[clap(long, value_name = "SIZE")] pub dynamic_memory_guard_size: Option, + /// Bytes to reserve at the end of linear memory for growth for dynamic + /// memories. + #[clap(long, value_name = "SIZE")] + pub dynamic_memory_reserved_for_growth: Option, + /// Enable Cranelift's internal debug verifier (expensive) #[clap(long)] pub enable_cranelift_debug_verifier: bool, @@ -323,6 +328,9 @@ impl CommonOptions { if let Some(size) = self.dynamic_memory_guard_size { config.dynamic_memory_guard_size(size); } + if let Some(size) = self.dynamic_memory_reserved_for_growth { + config.dynamic_memory_reserved_for_growth(size); + } // If fuel has been configured, set the `consume fuel` flag on the config. if self.fuel.is_some() {