diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2026-08-23 13:40:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-23 13:40:38 +0200 |
| commit | 951c8070169e8bd970940029156f305e741aecdb (patch) | |
| tree | fbf012a24cbd380b689958122e7f66a2a85d23e1 /crates/cli | |
| parent | 358a183e5c12c32b8836acf9c71799f56e00b036 (diff) | |
chore: remove LinearMemory trait (#53)
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/cli')
| -rw-r--r-- | crates/cli/src/engine_flags.rs | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/crates/cli/src/engine_flags.rs b/crates/cli/src/engine_flags.rs index 3d90847..edc56aa 100644 --- a/crates/cli/src/engine_flags.rs +++ b/crates/cli/src/engine_flags.rs @@ -1,4 +1,4 @@ -use anyhow::{Result, bail}; +use anyhow::Result; use clap::{Args, ValueEnum}; use tinywasm::{Engine, StackConfig, engine::FuelPolicy}; @@ -8,18 +8,6 @@ pub struct EngineFlags { #[arg(long, value_enum)] pub fuel_policy: Option<FuelPolicyArg>, - /// Trap immediately on memory or stack allocation failure - #[arg(long)] - pub trap_on_oom: bool, - - /// Memory backend to use for instantiated memories - #[arg(long, value_enum)] - pub memory_backend: Option<MemoryBackendArg>, - - /// Chunk size in bytes for the paged memory backend - #[arg(long, default_value_t = 64 * 1024)] - pub memory_page_chunk_size: usize, - /// Fixed value stack size for all value lanes #[arg(long, conflicts_with = "value_stack_dynamic")] pub value_stack_size: Option<usize>, @@ -43,12 +31,6 @@ pub enum FuelPolicyArg { Weighted, } -#[derive(Clone, Copy, ValueEnum)] -pub enum MemoryBackendArg { - Vec, - Paged, -} - #[derive(Clone)] pub struct StackSpec { initial: usize, @@ -86,18 +68,6 @@ impl EngineFlags { }); } - if let Some(memory_backend) = self.memory_backend { - config = config.with_memory_backend(match memory_backend { - MemoryBackendArg::Vec => tinywasm::MemoryBackend::vec(), - MemoryBackendArg::Paged => { - if self.memory_page_chunk_size == 0 { - bail!("--memory-page-chunk-size must be greater than zero"); - } - tinywasm::MemoryBackend::paged(self.memory_page_chunk_size) - } - }); - } - if let Some(value_stack_size) = self.value_stack_size { config = config.with_value_stack(StackConfig::fixed(value_stack_size)); } @@ -114,10 +84,6 @@ impl EngineFlags { config = config.with_call_stack(call_stack_dynamic.into_stack_config()); } - if self.trap_on_oom { - config = config.with_trap_on_oom(true); - } - Ok(Engine::new(config)) } } |
