Remove `DEFAULT_` from `DEFAULT_MAJOR_GC_INC_RATIO`; ref #3998

Because unlike other GC ratio constants, it's not a default value.
parent c6736357
......@@ -344,7 +344,7 @@ add_heap(mrb_state *mrb, mrb_gc *gc)
#define DEFAULT_GC_INTERVAL_RATIO 200
#define DEFAULT_GC_STEP_RATIO 200
#define DEFAULT_MAJOR_GC_INC_RATIO 200
#define MAJOR_GC_INC_RATIO 200
#define is_generational(gc) ((gc)->generational)
#define is_major_gc(gc) (is_generational(gc) && (gc)->full)
#define is_minor_gc(gc) (is_generational(gc) && !(gc)->full)
......@@ -1209,7 +1209,7 @@ mrb_incremental_gc(mrb_state *mrb)
}
if (is_major_gc(gc)) {
gc->majorgc_old_threshold = gc->live_after_mark/100 * DEFAULT_MAJOR_GC_INC_RATIO;
gc->majorgc_old_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
gc->full = FALSE;
}
else if (is_minor_gc(gc)) {
......@@ -1248,7 +1248,7 @@ mrb_full_gc(mrb_state *mrb)
gc->threshold = (gc->live_after_mark/100) * gc->interval_ratio;
if (is_generational(gc)) {
gc->majorgc_old_threshold = gc->live_after_mark/100 * DEFAULT_MAJOR_GC_INC_RATIO;
gc->majorgc_old_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
gc->full = FALSE;
}
......@@ -1449,7 +1449,7 @@ change_gen_gc_mode(mrb_state *mrb, mrb_gc *gc, mrb_bool enable)
}
else if (!is_generational(gc) && enable) {
incremental_gc_until(mrb, gc, MRB_GC_STATE_ROOT);
gc->majorgc_old_threshold = gc->live_after_mark/100 * DEFAULT_MAJOR_GC_INC_RATIO;
gc->majorgc_old_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
gc->full = FALSE;
}
gc->generational = enable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment