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(
6145
6145
// arenas.
6146
6146
MOZ_ASSERT (IsOnMainThreadWeak ());
6147
6147
6148
+ uint64_t now = GetTimestampNS ();
6149
+ uint64_t reuseGraceNS = (uint64_t )aReuseGraceMS * 1000 * 1000 ;
6148
6150
arena_t * found = nullptr ;
6149
6151
{
6150
6152
MutexAutoLock lock (mPurgeListLock );
6151
6153
if (mOutstandingPurges .isEmpty ()) {
6152
6154
return purge_result_t ::Done;
6153
6155
}
6154
- uint64_t now = GetTimestampNS ();
6155
- uint64_t reuseGraceNS = (uint64_t )aReuseGraceMS * 1000 * 1000 ;
6156
6156
for (arena_t & arena : mOutstandingPurges ) {
6157
6157
if (now - arena.mLastSignificantReuseNS >= reuseGraceNS) {
6158
6158
found = &arena;
@@ -6176,8 +6176,10 @@ purge_result_t ArenaCollection::MayPurgeSteps(
6176
6176
arena_t ::PurgeResult pr;
6177
6177
do {
6178
6178
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)());
6181
6183
6182
6184
if (pr == arena_t ::PurgeResult::Continue) {
6183
6185
// 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