feat: bumpalo

This commit is contained in:
2025-05-23 12:09:53 +08:00
parent 53cbb37b00
commit a47a08b051
12 changed files with 130 additions and 127 deletions

View File

@@ -2,6 +2,7 @@
extern crate test;
use bumpalo::Bump;
use hashbrown::{HashMap, HashSet};
use inkwell::context::Context;
@@ -30,11 +31,12 @@ fn test_expr(expr: &str, expected: Value) {
prog.symbols.into(),
prog.symmap.into(),
prog.consts,
Bump::new(),
jit,
);
let env = env(&vm);
let value = vm
.eval(prog.top_level.into_iter(), env.into())
.eval(prog.top_level.into_iter(), vm.bump.alloc(env))
.unwrap()
.to_public(&vm, &mut HashSet::new());
assert_eq!(value, expected);