feat(env): Rc

This commit is contained in:
2025-05-17 19:10:10 +08:00
parent ff9afd0cc1
commit fb14027845
6 changed files with 44 additions and 65 deletions

View File

@@ -466,7 +466,7 @@ pub struct Thunk<'vm> {
#[derive(Debug, IsVariant, Unwrap, Clone)]
pub enum _Thunk<'vm> {
Code(&'vm OpCodes, OnceCell<Rc<Env<'vm>>>),
Code(&'vm OpCodes, OnceCell<Env<'vm>>),
SuspendedFrom(*const Thunk<'vm>),
Value(Value<'vm>),
}
@@ -478,7 +478,7 @@ impl<'vm> Thunk<'vm> {
}
}
pub fn capture(&self, env: Rc<Env<'vm>>) {
pub fn capture(&self, env: Env<'vm>) {
if let _Thunk::Code(_, envcell) = &*self.thunk.borrow() {
envcell.get_or_init(|| env);
}