File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6145,14 +6145,14 @@ purge_result_t ArenaCollection::MayPurgeSteps(
61456145 // arenas.
61466146 MOZ_ASSERT (IsOnMainThreadWeak ());
61476147
6148+ uint64_t now = GetTimestampNS ();
6149+ uint64_t reuseGraceNS = (uint64_t )aReuseGraceMS * 1000 * 1000 ;
61486150 arena_t * found = nullptr ;
61496151 {
61506152 MutexAutoLock lock (mPurgeListLock );
61516153 if (mOutstandingPurges .isEmpty ()) {
61526154 return purge_result_t ::Done;
61536155 }
6154- uint64_t now = GetTimestampNS ();
6155- uint64_t reuseGraceNS = (uint64_t )aReuseGraceMS * 1000 * 1000 ;
61566156 for (arena_t & arena : mOutstandingPurges ) {
61576157 if (now - arena.mLastSignificantReuseNS >= reuseGraceNS) {
61586158 found = &arena;
@@ -6176,8 +6176,10 @@ purge_result_t ArenaCollection::MayPurgeSteps(
61766176 arena_t ::PurgeResult pr;
61776177 do {
61786178 pr = found->Purge (PurgeIfThreshold);
6179- } while (pr == arena_t ::PurgeResult::Continue && aKeepGoing &&
6180- (*aKeepGoing)());
6179+ now = GetTimestampNS ();
6180+ } while (pr == arena_t ::PurgeResult::Continue &&
6181+ (now - found->mLastSignificantReuseNS >= reuseGraceNS) &&
6182+ aKeepGoing && (*aKeepGoing)());
61816183
61826184 if (pr == arena_t ::PurgeResult::Continue) {
61836185 // If there's more work to do we re-insert the arena into the purge queue.
You can’t perform that action at this time.
0 commit comments