Patchwork Handle USING_MADVISE without USING_MMAP

login
register
mail settings
Submitter Andi Kleen
Date Oct. 17, 2011, 5:29 p.m.
Message ID <20111017172957.GD15908@one.firstfloor.org>
Download mbox | patch
Permalink /patch/120272/
State New
Headers show

Comments

Andi Kleen - Oct. 17, 2011, 5:29 p.m.
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.

Patch

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