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)

This reverts commit 037938d.
  • Loading branch information
ChiaHungDuan committed Oct 14, 2024
1 parent 76173b1 commit 59e3042
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 59e3042

Please sign in to comment.