public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Handle USING_MADVISE without USING_MMAP
@ 2011-10-17 17:43 Andi Kleen
  0 siblings, 0 replies; only message in thread
From: Andi Kleen @ 2011-10-17 17:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: ktietz


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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-17 17:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17 17:43 [PATCH] Handle USING_MADVISE without USING_MMAP Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).