From: Ivan Maidanski Date: Mon, 26 Dec 2011 12:36:07 +0000 (+0400) Subject: configure: Add script code to force USE_MMAP for some targets X-Git-Tag: gc7_3alpha2~269 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b64dd3bc1e5a23e677c96b478d55648a0730ab75;p=gc configure: Add script code to force USE_MMAP for some targets (Apply part of commit 21a49a9 from 'gcc_boehmgc' branch) * configure.ac (gc_use_mmap): New variable (blank currently); add comment and FIXME. * configure.ac (USE_MMAP): Force define in case of gc_use_mmap is yes. --- diff --git a/configure.ac b/configure.ac index 4ccc59a9..4142c046 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,10 @@ AC_PROG_INSTALL # Special CFLAGS to use when building gc_cflags="" +# gc_use_mmap Set to "yes" on platforms where mmap should be used instead +# of sbrk. This will define USE_MMAP. +gc_use_mmap="" + # We should set -fexceptions if we are using gcc and might be used # inside something like gcj. This is the zeroth approximation: if test :"$GCC": = :yes: ; then @@ -55,6 +59,13 @@ else esac fi +case "${host}" in + *-linux*) + # FIXME: This seems to be no longer needed as configured in gcconfig.h + #gc_use_mmap=yes + ;; +esac + # target_optspace --enable-target-optspace ("yes", "no", "") case "${target_optspace}:${host}" in yes:*) @@ -780,6 +791,11 @@ if test "${enable_munmap}" != ""; then fi AC_DEFINE_UNQUOTED([MUNMAP_THRESHOLD], [${MUNMAP_THRESHOLD}], [Number of GC cycles to wait before unmapping an unused block.]) +else + if test "${gc_use_mmap}" = "yes"; then + AC_DEFINE([USE_MMAP], 1, + [Define to use mmap instead of sbrk to expand the heap.]) + fi fi AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")