Skip to content

Commit 53c9553

Browse files
authored
[scudo] Apply the min release threshold to the group (#112014)
For the block smaller than a page size, one block is unlikely to introduce more unused pages (at most 2 if it acrosses the page boundary and both touched pages are unused). So it's better to apply the threshold to reduce the time of scanning groups that can't release any new pages.
1 parent d4efc3e commit 53c9553

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,8 @@ template <typename Config> class SizeClassAllocator64 {
14921492
}
14931493

14941494
const uptr PushedBytesDelta = BytesInBG - BG->BytesInBGAtLastCheckpoint;
1495+
if (PushedBytesDelta < getMinReleaseAttemptSize(BlockSize))
1496+
continue;
14951497

14961498
// Given the randomness property, we try to release the pages only if the
14971499
// bytes used by free blocks exceed certain proportion of group size. Note

0 commit comments

Comments
 (0)