Skip to content

Commit cc04bbb

Browse files
authored
[scudo] Fix the calculation of PushedBytesDelta (#95177)
BytesInBG is always greater or equal to BG->BytesInBGAtLastCheckpoint. Note that the bug led to unnecessary attempts of page releasing and doesn't have critical impact on the correctness.
1 parent 3fce145 commit cc04bbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ template <typename Config> class SizeClassAllocator64 {
13921392
continue;
13931393
}
13941394

1395-
const uptr PushedBytesDelta = BG->BytesInBGAtLastCheckpoint - BytesInBG;
1395+
const uptr PushedBytesDelta = BytesInBG - BG->BytesInBGAtLastCheckpoint;
13961396

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

0 commit comments

Comments
 (0)