From 735cc3dd9476a9058e71fc04e4d87f60b5a89b59 Mon Sep 17 00:00:00 2001 From: bryce Date: Wed, 16 Feb 2005 04:10:42 +0000 Subject: [PATCH] 2005-02-15 Bryce McKinlay PR libgcj/19823 * configure.host: Set gc_use_mmap on *-linux*. * configure.ac: Define USE_MMAP if gc_use_mmap is set. * include/private/gc_priv.h: Include gc_config.h. * configure, include/gc_config.h.in: Rebuilt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95094 138bc75d-0d04-0410-961f-82ee72b054a4 --- boehm-gc/ChangeLog | 8 ++++++++ boehm-gc/configure | 8 ++++++++ boehm-gc/configure.ac | 4 ++++ boehm-gc/configure.host | 9 +++++++++ boehm-gc/include/gc_config.h.in | 3 +++ boehm-gc/include/private/gc_priv.h | 4 ++++ 6 files changed, 36 insertions(+) diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index b9c7c46..2194ad5 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,11 @@ +2005-02-15 Bryce McKinlay + + PR libgcj/19823 + * configure.host: Set gc_use_mmap on *-linux*. + * configure.ac: Define USE_MMAP if gc_use_mmap is set. + * include/private/gc_priv.h: Include gc_config.h. + * configure, include/gc_config.h.in: Rebuilt. + 2005-02-07 Hans Boehm * allchblk.c (GC_allochblk_nth): Dont overlook available space if diff --git a/boehm-gc/configure b/boehm-gc/configure index 36243d4..b205d32 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -6558,6 +6558,14 @@ _ACEOF fi fi; +if test "${gc_use_mmap}" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define USE_MMAP 1 +_ACEOF + +fi + if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then toolexecdir='$(exec_prefix)/$(target_noncanonical)' diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac index 208a916..dfb0e17 100644 --- a/boehm-gc/configure.ac +++ b/boehm-gc/configure.ac @@ -446,6 +446,10 @@ AC_ARG_ENABLE(gc-debug, esac fi]) +if test "${gc_use_mmap}" = "yes"; then + AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory]) +fi + if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then toolexecdir='$(exec_prefix)/$(target_noncanonical)' diff --git a/boehm-gc/configure.host b/boehm-gc/configure.host index a98a0a7..97f4dac 100644 --- a/boehm-gc/configure.host +++ b/boehm-gc/configure.host @@ -18,8 +18,11 @@ # It sets the following shell variables: # gc_cflags Special CFLAGS to use when building +# gc_use_mmap Set to "yes" on platforms where mmap should be used instead +# of sbrk. This will define USE_MMAP. gc_cflags="" +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: @@ -37,6 +40,12 @@ else esac fi +case "${host}" in + *-linux*) + gc_use_mmap=yes + ;; +esac + case "${target_optspace}:${host}" in yes:*) gc_cflags="${gc_cflags} -Os" diff --git a/boehm-gc/include/gc_config.h.in b/boehm-gc/include/gc_config.h.in index 60ffb97..92f1b2c 100644 --- a/boehm-gc/include/gc_config.h.in +++ b/boehm-gc/include/gc_config.h.in @@ -145,6 +145,9 @@ /* define GC_local_malloc() & GC_local_malloc_atomic() */ #undef THREAD_LOCAL_ALLOC +/* use MMAP instead of sbrk to get new memory */ +#undef USE_MMAP + /* POSIX version of C Source */ #undef _POSIX_C_SOURCE diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h index e5bd52b..c336ce5 100644 --- a/boehm-gc/include/private/gc_priv.h +++ b/boehm-gc/include/private/gc_priv.h @@ -19,6 +19,10 @@ # ifndef GC_PRIVATE_H # define GC_PRIVATE_H +/* Autoconf definitions. */ +/* FIXME: This should really be included directly from each .c file. */ +#include + #if defined(mips) && defined(SYSTYPE_BSD) && defined(sony_news) /* sony RISC NEWS, NEWSOS 4 */ # define BSD_TIME -- 2.7.4