Remove max_arena_objects configuration
This isn't something we can't really control so out it goes, I guess. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -17,9 +17,6 @@ struct Opt {
|
|||||||
|
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
max_stack_size: Option<usize>,
|
max_stack_size: Option<usize>,
|
||||||
|
|
||||||
#[structopt(long)]
|
|
||||||
max_arena_objects: Option<usize>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Result<T = (), E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
|
type Result<T = (), E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
|
||||||
@@ -43,7 +40,6 @@ fn main() -> Result {
|
|||||||
|
|
||||||
let mut machine = MachineBuilder::default()
|
let mut machine = MachineBuilder::default()
|
||||||
.max_stack_size(opt.max_stack_size)
|
.max_stack_size(opt.max_stack_size)
|
||||||
.max_arena_objects(opt.max_arena_objects)
|
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
if let Err(e) = machine.eval(stmts) {
|
if let Err(e) = machine.eval(stmts) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ use crate::object::*;
|
|||||||
use crate::scope::*;
|
use crate::scope::*;
|
||||||
use crate::syn::{ast::SpStmt, span::Span};
|
use crate::syn::{ast::SpStmt, span::Span};
|
||||||
use crate::vm::{error::*, inst::*};
|
use crate::vm::{error::*, inst::*};
|
||||||
use std::cell::RefCell;
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
@@ -318,7 +317,6 @@ pub struct MachineBuilder {
|
|||||||
pub(super) globals: BTreeMap<Word, Value>,
|
pub(super) globals: BTreeMap<Word, Value>,
|
||||||
pub(super) scope_stack: ScopeStack,
|
pub(super) scope_stack: ScopeStack,
|
||||||
pub(super) max_stack_size: Option<usize>,
|
pub(super) max_stack_size: Option<usize>,
|
||||||
pub(super) max_arena_objects: Option<usize>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MachineBuilder {
|
impl MachineBuilder {
|
||||||
@@ -327,11 +325,6 @@ impl MachineBuilder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn max_arena_objects(mut self, max_arena_objects: Option<usize>) -> Self {
|
|
||||||
self.max_arena_objects = max_arena_objects;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) fn register_builtin_fun(
|
pub(super) fn register_builtin_fun(
|
||||||
&mut self,
|
&mut self,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
|||||||
Reference in New Issue
Block a user