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.
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user