feat: lookup at downgrade time

works, but leaks memory
This commit is contained in:
2025-06-01 09:20:04 +08:00
parent 7d6168fdae
commit 20b2b6f1ef
20 changed files with 762 additions and 651 deletions

View File

@@ -2,11 +2,10 @@ use std::ops::Deref;
use std::rc::Rc;
use derive_more::Constructor;
use gc_arena::{Collect, Gc, Mutation};
use gc_arena::Collect;
use hashbrown::{HashMap, HashSet};
use itertools::Itertools;
use crate::env::VmEnv;
use crate::vm::VM;
use super::super::public as p;
@@ -58,14 +57,6 @@ impl<'gc> AttrSet<'gc> {
self.data.get(&sym).is_some()
}
pub fn capture(&mut self, env: Gc<'gc, VmEnv<'gc>>, mc: &Mutation<'gc>) {
self.data.iter().for_each(|(_, v)| {
if let Value::Thunk(ref thunk) = v.clone() {
thunk.capture_env(env, mc);
}
})
}
pub fn update(&mut self, other: &AttrSet<'gc>) {
for (k, v) in other.data.iter() {
self.push_attr_force(*k, v.clone())