This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Handle USING_MADVISE without USING_MMAP


I plan to check in the following patch as obvious after it passed
testing. 

cygwin has a MADV_DONTNEED, but does not use mmap. The ifdefs for
madvise assumed this wouldn't happen and it broke the cygwin build.

Just don't set USING_MADVISE when USING_MMAP is not set. Thanks
to Kai Titz for testing.

-Andi

2011-10-17  Andi Kleen  <ak@linux.intel.com>

       * ggc-page.c (USING_MADVISE): Adjust ifdef to check for
       USING_MMAP.

diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 9b35291..2da99db 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3.  If not see
 #define USING_MALLOC_PAGE_GROUPS
 #endif
 
-#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED)
+#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) && defined(USING_MMAP)
 # define USING_MADVISE
 #endif
 
-- 
1.7.5.4

-- 
ak@linux.intel.com -- Speaking for myself only.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]