Bug 1747330, tweak GC_SLICE_DURING_IDLE handling so that negative values are reported as 0, r=pbone

Differential Revision: https://phabricator.services.mozilla.com/D135508
This commit is contained in:
Olli Pettay 2022-01-11 11:56:10 +00:00
Родитель 901a35ec10
Коммит 5be5146c05
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -315,7 +315,10 @@ bool CCGCScheduler::GCRunnerFiredDoGC(TimeStamp aDeadline,
if (!aDeadline.IsNull()) {
if (aDeadline < now) {
// This slice overflowed the idle period.
idleDuration = aDeadline - startTimeStamp;
if (aDeadline > startTimeStamp) {
idleDuration = aDeadline - startTimeStamp;
}
// Otherwise the whole slice was done outside the idle period.
} else {
// Note, we don't want to use duration here, since it may contain
// data also from JS engine triggered GC slices.