From: Vitaly Buka Date: Thu, 27 May 2021 16:49:34 +0000 (-0700) Subject: [NFC][scudo] Rename internal function X-Git-Tag: llvmorg-14-init~5409 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb69763ad8ea18ef1b0d739847da0be4ab099d51;p=platform%2Fupstream%2Fllvm.git [NFC][scudo] Rename internal function --- diff --git a/compiler-rt/lib/scudo/standalone/linux.cpp b/compiler-rt/lib/scudo/standalone/linux.cpp index 301bdcd..75757ca 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(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(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(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