feat(env): Rc
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user