Skip to content

Commit 113b8b0

Browse files
author
git apple-llvm automerger
committed
Merge commit '885cb59315f9' from llvm.org/main into next
2 parents 84e223b + 885cb59 commit 113b8b0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler-rt/lib/scudo/standalone/primary64.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,13 @@ bool SizeClassAllocator64<Config>::hasChanceToReleasePages(
15651565
if (DiffSinceLastReleaseNs < 2 * IntervalNs)
15661566
return false;
15671567
} else if (DiffSinceLastReleaseNs < IntervalNs) {
1568+
// `TryReleaseThreshold` is capped by (1UL << GroupSizeLog) / 2). If
1569+
// RegionPushedBytesDelta grows to twice the threshold, it implies some
1570+
// huge deallocations have happened so we better try to release some
1571+
// pages. Note this tends to happen for larger block sizes.
1572+
if (RegionPushedBytesDelta > (1ULL << GroupSizeLog))
1573+
return true;
1574+
15681575
// In this case, we are over the threshold but we just did some page
15691576
// release in the same release interval. This is a hint that we may want
15701577
// a higher threshold so that we can release more memory at once.

0 commit comments

Comments
 (0)