[llvm] r359758 - [Support] Don't check MAP_ANONYMOUS, just use MAP_ANON
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed May 1 22:58:09 PDT 2019
Author: maskray
Date: Wed May 1 22:58:09 2019
New Revision: 359758
URL: http://llvm.org/viewvc/llvm-project?rev=359758&view=rev
Log:
[Support] Don't check MAP_ANONYMOUS, just use MAP_ANON
Though being marked "deprecated" by the Linux man-pages project
(MAP_ANON is a synonym of MAP_ANONYMOUS), it is the mostly widely
available macro - many systems that don't provide MAP_ANONYMOUS have
MAP_ANON. MAP_ANON is also used here and there in compiler-rt.
Modified:
llvm/trunk/lib/Support/Unix/Memory.inc
Modified: llvm/trunk/lib/Support/Unix/Memory.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Memory.inc?rev=359758&r1=359757&r2=359758&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Memory.inc (original)
+++ llvm/trunk/lib/Support/Unix/Memory.inc Wed May 1 22:58:09 2019
@@ -93,14 +93,7 @@ Memory::allocateMappedMemory(size_t NumB
int fd = -1;
- int MMFlags = MAP_PRIVATE |
-#ifdef MAP_ANONYMOUS
- MAP_ANONYMOUS
-#else
- MAP_ANON
-#endif
- ; // Ends statement above
-
+ int MMFlags = MAP_PRIVATE | MAP_ANON;
int Protect = getPosixProtectionFlags(PFlags);
#if defined(__NetBSD__) && defined(PROT_MPROTECT)
More information about the llvm-commits
mailing list