[compiler-rt] [scudo] Fix the calculation of PushedBytesDelta (PR #95177)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 14:48:24 PDT 2024
https://github.com/ChiaHungDuan created https://github.com/llvm/llvm-project/pull/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.
>From d78dcd2c25cfb7186732c8399d10f88400a44725 Mon Sep 17 00:00:00 2001
From: Chia-hung Duan <chiahungduan at google.com>
Date: Tue, 11 Jun 2024 21:42:01 +0000
Subject: [PATCH] [scudo] Fix the calculation of PushedBytesDelta
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.
---
compiler-rt/lib/scudo/standalone/primary64.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h
index bed2ccb8b992a..8a583bacb4a93 100644
--- a/compiler-rt/lib/scudo/standalone/primary64.h
+++ b/compiler-rt/lib/scudo/standalone/primary64.h
@@ -1392,7 +1392,7 @@ template <typename Config> class SizeClassAllocator64 {
continue;
}
- const uptr PushedBytesDelta = BG->BytesInBGAtLastCheckpoint - BytesInBG;
+ const uptr PushedBytesDelta = BytesInBG - BG->BytesInBGAtLastCheckpoint;
// 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
More information about the llvm-commits
mailing list