mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
gc.c (mrb_field_write_barrier): change the condition
Minor GC may be suspended with the MRB_GC_STATE_SWEEP.
This commit is contained in:
@@ -1349,12 +1349,11 @@ mrb_field_write_barrier(mrb_state *mrb, struct RBasic *obj, struct RBasic *value
|
||||
mrb_assert(gc->state == MRB_GC_STATE_MARK || (!is_dead(gc, value) && !is_dead(gc, obj)));
|
||||
mrb_assert(is_generational(gc) || gc->state != MRB_GC_STATE_ROOT);
|
||||
|
||||
if (is_generational(gc) || gc->state == MRB_GC_STATE_MARK) {
|
||||
add_gray_list(mrb, gc, value);
|
||||
if (gc->state == MRB_GC_STATE_SWEEP) {
|
||||
paint_partial_white(gc, obj); /* for never write barriers */
|
||||
}
|
||||
else {
|
||||
mrb_assert(gc->state == MRB_GC_STATE_SWEEP);
|
||||
paint_partial_white(gc, obj); /* for never write barriers */
|
||||
add_gray_list(mrb, gc, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user