Skip to content

Commit

Permalink
Use fiber marking instead of mark_context.
Browse files Browse the repository at this point in the history
To avoid redundant `mark_context()`.
  • Loading branch information
matz committed Apr 25, 2017
1 parent 6088276 commit 01f7825
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,8 @@ mark_context(mrb_state *mrb, struct mrb_context *c)
}
/* mark fibers */
mrb_gc_mark(mrb, (struct RBasic*)c->fib);
if (c->prev) {
mark_context(mrb, c->prev);
if (c->prev && c->prev->fib) {
mrb_gc_mark(mrb, (struct RBasic*)c->prev->fib);
}
}

Expand Down Expand Up @@ -882,10 +882,10 @@ root_scan_phase(mrb_state *mrb, mrb_gc *gc)
mrb_gc_mark(mrb, (struct RBasic*)mrb->arena_err);
#endif

mark_context(mrb, mrb->root_c);
if (mrb->root_c != mrb->c) {
mark_context(mrb, mrb->c);
}
mark_context(mrb, mrb->root_c);
}

static size_t
Expand Down

0 comments on commit 01f7825

Please sign in to comment.