summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-10-29 11:58:10 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-10-29 11:58:10 +0900
commit3dc3643e34e1e9f119594ebd550f19e876d60e26 (patch)
treea5128c2a4af92da31581419a60b2d956bc0852c9 /src
parent34872e90d44bdde64e18b7774cf09495ec043e24 (diff)
downloadmruby-3dc3643e34e1e9f119594ebd550f19e876d60e26.tar.gz
mruby-3dc3643e34e1e9f119594ebd550f19e876d60e26.zip
Marking from terminated fibers are not needed; ref #4143
The old condition marks the top-level callinfo even after the fiber is terminated.
Diffstat (limited to 'src')
-rw-r--r--src/gc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gc.c b/src/gc.c
index 9b11b7a83..bacc322e8 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -801,10 +801,10 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
struct mrb_context *c = ((struct RFiber*)obj)->cxt;
if (c && c != mrb->root_c) {
- mrb_callinfo *ci = c->ci;
- mrb_callinfo *ce = c->cibase;
+ if (!end && c->status != MRB_FIBER_TERMINATED) {
+ mrb_callinfo *ci = c->ci;
+ mrb_callinfo *ce = c->cibase;
- if (!end) {
while (ce <= ci) {
struct REnv *e = ci->env;
if (e && !is_dead(&mrb->gc, e) &&