incremental GC: split "incremental" finalization to single step

Don't finalize after performing some marking work, since
finalization is in one chunk, so it's best to avoid combining
that delay with others.
This commit is contained in:
Matthew Flatt 2015-11-28 05:38:56 -07:00
parent 493eb1de7f
commit ad2dd24fb8

View File

@ -5918,11 +5918,12 @@ static void garbage_collect(NewGC *gc, int force_full, int no_full, int switchin
if (do_incremental) {
if (!gc->finishing_incremental) {
int fuel = INCREMENTAL_COLLECT_FUEL_PER_100M * ((gc->memory_in_use / (1024 * 1024 * 100)) + 1);
mark_finalizer_structs(gc, 1);
propagate_incremental_marks(gc, 1, fuel);
if (mark_stack_is_empty(gc->inc_mark_stack)) {
/* If we run out of incremental marking work,
if (!mark_stack_is_empty(gc->inc_mark_stack)) {
int fuel = INCREMENTAL_COLLECT_FUEL_PER_100M * ((gc->memory_in_use / (1024 * 1024 * 100)) + 1);
propagate_incremental_marks(gc, 1, fuel);
} else {
/* We ran out of incremental marking work, so
perform major-GC finalization in one go. */
mark_and_finalize_all_incremental(gc TIME_ARGS);
BTC_clean_up_gen1(gc);