mirror of
https://github.com/urbit/ares.git
synced 2024-11-22 15:08:54 +03:00
wip: test interpret_with_guard
This commit is contained in:
parent
5efbc074e2
commit
fcb1ba51da
@ -1,5 +1,5 @@
|
||||
use crate::interpreter::{Error, Mote, Result};
|
||||
use crate::noun::D;
|
||||
use crate::interpreter::{interpret, Context, Error, Mote, Result};
|
||||
use crate::noun::{Noun, D};
|
||||
use ares_guard::*;
|
||||
use assert_no_alloc::permit_alloc;
|
||||
use std::convert::TryFrom;
|
||||
@ -98,3 +98,10 @@ pub fn call_with_guard<F: FnMut() -> Result>(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn interpret_with_guard(context: &mut Context, eve: Noun, lyf: Noun) -> Result {
|
||||
let stack_pp = context.stack.get_stack_pointer_pointer() as *const *const u64;
|
||||
let alloc_pp = context.stack.get_alloc_pointer_pointer() as *const *const u64;
|
||||
|
||||
call_with_guard(stack_pp, alloc_pp, &mut || interpret(context, eve, lyf))
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
use crate::hamt::Hamt;
|
||||
use crate::guard::interpret_with_guard;
|
||||
use crate::interpreter;
|
||||
use crate::interpreter::{inc, interpret, Error, Mote};
|
||||
use crate::jets::cold::Cold;
|
||||
@ -143,7 +144,7 @@ impl Context {
|
||||
snapshot: Option<Snapshot>,
|
||||
constant_hot_state: &[HotEntry],
|
||||
) -> Self {
|
||||
let mut stack = NockStack::new(2048 << 10 << 10, 0);
|
||||
let mut stack = NockStack::new(128 << 10 << 10, 0);
|
||||
let newt = Newt::new();
|
||||
let cache = Hamt::<Noun>::new(&mut stack);
|
||||
|
||||
@ -402,7 +403,7 @@ fn slam(context: &mut Context, axis: u64, ovo: Noun) -> Result<Noun, Error> {
|
||||
let fol = T(stack, &[D(8), pul, D(9), D(2), D(10), sam, D(0), D(2)]);
|
||||
let sub = T(stack, &[arvo, ovo]);
|
||||
|
||||
interpret(&mut context.nock_context, sub, fol)
|
||||
interpret_with_guard(&mut context.nock_context, sub, fol)
|
||||
}
|
||||
|
||||
fn peek(context: &mut Context, ovo: Noun) -> Noun {
|
||||
|
Loading…
Reference in New Issue
Block a user