Add a --dynamic-memory-reserved-for-growth CLI flag (#5980)

Maps to the corresponding `wasmtime::Config` option. The motivation here
is largely completeness and was something I was looking into with the
failures in #5970
This commit is contained in:
Alex Crichton
2023-03-10 11:58:02 -06:00
committed by GitHub
parent 7650d857fa
commit 0751cba6e2

View File

@@ -196,6 +196,11 @@ pub struct CommonOptions {
#[clap(long, value_name = "SIZE")]
pub dynamic_memory_guard_size: Option<u64>,
/// 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<u64>,
/// 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() {