[compiler-rt] eb69763 - [NFC][scudo] Rename internal function
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu May 27 10:41:14 PDT 2021
Author: Vitaly Buka
Date: 2021-05-27T10:41:07-07:00
New Revision: eb69763ad8ea18ef1b0d739847da0be4ab099d51
URL: https://github.com/llvm/llvm-project/commit/eb69763ad8ea18ef1b0d739847da0be4ab099d51
DIFF: https://github.com/llvm/llvm-project/commit/eb69763ad8ea18ef1b0d739847da0be4ab099d51.diff
LOG: [NFC][scudo] Rename internal function
Added:
Modified:
compiler-rt/lib/scudo/standalone/linux.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/linux.cpp b/compiler-rt/lib/scudo/standalone/linux.cpp
index 301bdcd34dad4..75757cae26715 100644
--- a/compiler-rt/lib/scudo/standalone/linux.cpp
+++ b/compiler-rt/lib/scudo/standalone/linux.cpp
@@ -90,7 +90,7 @@ void setMemoryPermission(uptr Addr, uptr Size, uptr Flags,
dieOnMapUnmapError();
}
-static bool madviseNeedsMemset() {
+static bool madviseNotNeedFails() {
const uptr Size = getPageSizeCached();
char *P = reinterpret_cast<char *>(mmap(0, Size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0));
@@ -105,12 +105,12 @@ static bool madviseNeedsMemset() {
return R;
}
-static bool madviseNeedsMemsetCached() {
+static bool madviseNotNeedFailsCached() {
static atomic_u8 Cache;
enum State : u8 { Unknown = 0, Yes = 1, No = 2 };
State NeedsMemset = static_cast<State>(atomic_load_relaxed(&Cache));
if (NeedsMemset == Unknown) {
- NeedsMemset = madviseNeedsMemset() ? Yes : No;
+ NeedsMemset = madviseNotNeedFails() ? Yes : No;
atomic_store_relaxed(&Cache, NeedsMemset);
}
return NeedsMemset == Yes;
@@ -119,7 +119,7 @@ static bool madviseNeedsMemsetCached() {
void releasePagesToOS(uptr BaseAddress, uptr Offset, uptr Size,
UNUSED MapPlatformData *Data) {
void *Addr = reinterpret_cast<void *>(BaseAddress + Offset);
- if (madviseNeedsMemsetCached()) {
+ if (madviseNotNeedFailsCached()) {
// Workaround for QEMU-user ignoring MADV_DONTNEED.
// https://github.com/qemu/qemu/blob/b1cffefa1b163bce9aebc3416f562c1d3886eeaa/linux-user/syscall.c#L11941
// https://bugs.launchpad.net/qemu/+bug/1926521
More information about the llvm-commits
mailing list