mirror of
https://github.com/janet-lang/janet
synced 2026-09-01 15:18:51 +00:00
When marshalling a closure, try to detach funcenvs
If possible, this will reduce the need to marshal fibers in many cases. Also add this logic to the GC so holding a closure that originally came from a fiber that crashed does not cause that fiber to hang around forever.
This commit is contained in:
@@ -184,6 +184,7 @@ static void marshal_one_env(MarshalState *st, JanetFuncEnv *env, int flags) {
|
||||
}
|
||||
}
|
||||
janet_v_push(st->seen_envs, env);
|
||||
janet_env_maybe_detach(env);
|
||||
pushint(st, env->offset);
|
||||
pushint(st, env->length);
|
||||
if (env->offset) {
|
||||
|
||||
Reference in New Issue
Block a user