Fix GC so collection rate is proportional to alloc rate

- Previous comments in dobjgc.cpp suggested that StepMul was used
  to determine how quickly garbage was collected based on how quickly
  memory was being allocated. This was not the case. Now it is.
- Remove calls to CheckGC from the thinkers. With GC running at a
  stable rate (once per frame), there should be no need to inject
  pauses into the collection process to keep it from injecting stutters
  (provided StepMul is sane). The risk of running out of memory because
  we don't run a collection pass absolutely every thinker should be
  practically zero.
- Reduce DEFAULT_GCMUL from 400 to 200, since it does what it says now
  instead of something else.
This commit is contained in:
Marisa Heit 2022-01-10 22:20:40 -06:00 committed by Christoph Oelckers
commit 31549997b4
3 changed files with 66 additions and 33 deletions

View file

@ -616,7 +616,6 @@ int FThinkerList::TickThinkers(FThinkerList *dest)
ThinkCount++;
node->CallTick();
node->ObjectFlags &= ~OF_JustSpawned;
GC::CheckGC();
}
node = NextToThink;
}
@ -667,7 +666,6 @@ int FThinkerList::ProfileThinkers(FThinkerList *dest)
node->CallTick();
prof.timer.Unclock();
node->ObjectFlags &= ~OF_JustSpawned;
GC::CheckGC();
}
node = NextToThink;
}