gc.h: rename majorgc_old_threashold to oldgen_threashold

This field means that if you have more old generation objects than
this value, major GC mode will be turned on.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-06-06 11:26:35 +09:00
parent b47c8b738a
commit 8b8e186688
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ typedef struct mrb_gc {
mrb_bool full :1;
mrb_bool generational :1;
mrb_bool out_of_memory :1;
size_t majorgc_old_threshold;
size_t oldgen_threshold;
} mrb_gc;
MRB_API mrb_bool mrb_object_dead_p(struct mrb_state *mrb, struct RBasic *object);
+4 -4
View File
@@ -1276,7 +1276,7 @@ mrb_incremental_gc(mrb_state *mrb)
gc->full = FALSE;
if (threshold < MAJOR_GC_TOOMANY) {
gc->majorgc_old_threshold = threshold;
gc->oldgen_threshold = threshold;
}
else {
/* too many objects allocated during incremental GC, */
@@ -1285,7 +1285,7 @@ mrb_incremental_gc(mrb_state *mrb)
}
}
else if (is_minor_gc(gc)) {
if (gc->live > gc->majorgc_old_threshold) {
if (gc->live > gc->oldgen_threshold) {
clear_all_old(mrb, gc);
gc->full = TRUE;
}
@@ -1316,7 +1316,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 * MAJOR_GC_INC_RATIO;
gc->oldgen_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
gc->full = FALSE;
}
@@ -1521,7 +1521,7 @@ change_gen_gc_mode(mrb_state *mrb, mrb_gc *gc, mrb_bool enable)
}
else if (!is_generational(gc) && enable) {
incremental_gc_finish(mrb, gc);
gc->majorgc_old_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
gc->oldgen_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
gc->full = FALSE;
}
gc->generational = enable;