Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiler-rt/lib/scudo/standalone/primary64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,13 @@ bool SizeClassAllocator64<Config>::hasChanceToReleasePages(
if (DiffSinceLastReleaseNs < 2 * IntervalNs)
return false;
} else if (DiffSinceLastReleaseNs < IntervalNs) {
// `TryReleaseThreshold` is capped by (1UL << GroupSizeLog) / 2). If
// RegionPushedBytesDelta grows to twice the threshold, it implies some
// huge deallocations have happened so we better try to release some
// pages. Note this tends to happen for larger block sizes.
if (RegionPushedBytesDelta > (1ULL << GroupSizeLog))
return true;

// In this case, we are over the threshold but we just did some page
// release in the same release interval. This is a hint that we may want
// a higher threshold so that we can release more memory at once.
Expand Down