feat: gc-arena
finally...
This commit is contained in:
@@ -604,13 +604,13 @@ impl<'gc> Thunk<'gc> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn suspend(&self, mc: &Mutation<'gc>) -> (&'gc OpCodes, Gc<'gc, VmEnv<'gc>>) {
|
||||
pub fn suspend(&self, mc: &Mutation<'gc>) -> Result<(&'gc OpCodes, Gc<'gc, VmEnv<'gc>>)> {
|
||||
let _Thunk::Code(opcodes, env) =
|
||||
std::mem::replace(&mut *self.thunk.borrow_mut(mc), _Thunk::Suspended)
|
||||
else {
|
||||
unreachable!()
|
||||
return Err(Error::EvalError("infinite recursion occured".into()))
|
||||
};
|
||||
(opcodes, env.unwrap())
|
||||
Ok((opcodes, env.unwrap()))
|
||||
}
|
||||
|
||||
pub fn insert_value(&self, value: Value<'gc>, mc: &Mutation<'gc>) {
|
||||
|
||||
Reference in New Issue
Block a user