[llvm] r282925 - Deal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP
Joerg Sonnenberger via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 13:17:24 PDT 2016
Author: joerg
Date: Fri Sep 30 15:17:23 2016
New Revision: 282925
URL: http://llvm.org/viewvc/llvm-project?rev=282925&view=rev
Log:
Deal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP
to check for the former, don't depend on (dangling) HAVE_MMAP_ANONYMOUS.
Modified:
llvm/trunk/include/llvm/Config/config.h.cmake
llvm/trunk/lib/Support/Unix/Memory.inc
Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=282925&r1=282924&r2=282925&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Fri Sep 30 15:17:23 2016
@@ -160,10 +160,6 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
-/* Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if
- it uses MAP_ANON */
-#undef HAVE_MMAP_ANONYMOUS
-
/* Define if mmap() can map files into memory */
#undef HAVE_MMAP_FILE
Modified: llvm/trunk/lib/Support/Unix/Memory.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Memory.inc?rev=282925&r1=282924&r2=282925&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Memory.inc (original)
+++ llvm/trunk/lib/Support/Unix/Memory.inc Fri Sep 30 15:17:23 2016
@@ -93,7 +93,7 @@ Memory::allocateMappedMemory(size_t NumB
int fd = -1;
int MMFlags = MAP_PRIVATE |
-#ifdef HAVE_MMAP_ANONYMOUS
+#ifdef MAP_ANONYMOUS
MAP_ANONYMOUS
#else
MAP_ANON
@@ -179,7 +179,7 @@ Memory::AllocateRWX(size_t NumBytes, con
int fd = -1;
int flags = MAP_PRIVATE |
-#ifdef HAVE_MMAP_ANONYMOUS
+#ifdef MAP_ANONYMOUS
MAP_ANONYMOUS
#else
MAP_ANON
More information about the llvm-commits
mailing list