Skip to content

Commit

Permalink
Reapply "[scudo] Apply the min release threshold to the group" (llvm#…
Browse files Browse the repository at this point in the history
…112252) (llvm#112266)

This reverts commit 037938d.

Fixed the iterator to avoid infinite loop
  • Loading branch information
ChiaHungDuan authored and DanielCChen committed Oct 16, 2024
1 parent e91b299 commit 193102b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler-rt/lib/scudo/standalone/primary64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,11 @@ template <typename Config> class SizeClassAllocator64 {
}

const uptr PushedBytesDelta = BytesInBG - BG->BytesInBGAtLastCheckpoint;
if (PushedBytesDelta < getMinReleaseAttemptSize(BlockSize)) {
Prev = BG;
BG = BG->Next;
continue;
}

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

0 comments on commit 193102b

Please sign in to comment.