Browse Source

Add a CLI option for the maximum stack size (#5156)

This should allow either increasing or decreasing it for debugging and
otherwise prodding at stack overflow behavior from the CLI.
pull/5064/merge
Alex Crichton 2 years ago
committed by GitHub
parent
commit
95ecb7e4d4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      crates/cli-flags/src/lib.rs

9
crates/cli-flags/src/lib.rs

@ -229,6 +229,11 @@ pub struct CommonOptions {
#[cfg(feature = "pooling-allocator")] #[cfg(feature = "pooling-allocator")]
#[clap(long)] #[clap(long)]
pub pooling_allocator: bool, pub pooling_allocator: bool,
/// Maximum stack size, in bytes, that wasm is allowed to consumed before a
/// stack overflow is reported.
#[clap(long)]
pub max_wasm_stack: Option<usize>,
} }
impl CommonOptions { impl CommonOptions {
@ -335,6 +340,10 @@ impl CommonOptions {
} }
} }
if let Some(max) = self.max_wasm_stack {
config.max_wasm_stack(max);
}
Ok(config) Ok(config)
} }

Loading…
Cancel
Save