2007-12-18 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Tue, 18 Dec 2007 23:58:11 +0000 (23:58 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:41 +0000 (21:06 +0400)
* gc_cpp.cc: Don't include gc_cpp.h from local directory.

2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz)

* allchblk.c, configure.ac (add --enable-munmap)
* configure: Regenerate.

ChangeLog
allchblk.c
configure
configure.ac
gc_cpp.cc

index b3a7f8c..fe6792e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-12-18  Hans Boehm <Hans.Boehm@hp.com>
+
+       * gc_cpp.cc: Don't include gc_cpp.h from local directory.
+
+2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz)
+
+       * allchblk.c, configure.ac (add --enable-munmap)
+       * configure: Regenerate.
+
 2007-12-10  Andreas Tobler  <a.tobler@schweiz.org>
 
        * dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
index 807a703..2be870e 100644 (file)
@@ -392,13 +392,15 @@ void GC_unmap_old(void)
     word sz;
     unsigned short last_rec, threshold;
     int i;
-#   define UNMAP_THRESHOLD 6
+#   ifndef MUNMAP_THRESHOLD
+#     define MUNMAP_THRESHOLD 6
+#   endif
     
     for (i = 0; i <= N_HBLK_FLS; ++i) {
       for (h = GC_hblkfreelist[i]; 0 != h; h = hhdr -> hb_next) {
         hhdr = HDR(h);
        if (!IS_MAPPED(hhdr)) continue;
-       threshold = (unsigned short)(GC_gc_no - UNMAP_THRESHOLD);
+       threshold = (unsigned short)(GC_gc_no - MUNMAP_THRESHOLD);
        last_rec = hhdr -> hb_last_reclaimed;
        if ((last_rec > GC_gc_no || last_rec < threshold)
            && threshold < GC_gc_no /* not recently wrapped */) {
index bdf2da8..53a7196 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.27 .
+# From configure.ac Revision: 1.28 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for gc 7.1alpha1.
 #
@@ -1534,6 +1534,7 @@ Optional Features:
   --enable-large-config   Optimize for large (> 100 MB) heap or root set
   --enable-gc-debug       include full support for pointer backtracing etc.
   --enable-gc-assertions  collector-internal assertion checking
+  --enable-munmap=N       return page to the os if empty for N collections
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -6854,7 +6855,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6857 "configure"' > conftest.$ac_ext
+  echo '#line 6858 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9117,11 +9118,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9120: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9121: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9124: \$? = $ac_status" >&5
+   echo "$as_me:9125: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9385,11 +9386,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9388: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9389: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9392: \$? = $ac_status" >&5
+   echo "$as_me:9393: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9489,11 +9490,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9492: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9493: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9496: \$? = $ac_status" >&5
+   echo "$as_me:9497: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11797,7 +11798,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11800 "configure"
+#line 11801 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11897,7 +11898,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11900 "configure"
+#line 11901 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14237,11 +14238,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14240: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14241: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14244: \$? = $ac_status" >&5
+   echo "$as_me:14245: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14341,11 +14342,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14344: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14345: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14348: \$? = $ac_status" >&5
+   echo "$as_me:14349: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15911,11 +15912,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15914: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15915: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15918: \$? = $ac_status" >&5
+   echo "$as_me:15919: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16015,11 +16016,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16018: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16019: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16022: \$? = $ac_status" >&5
+   echo "$as_me:16023: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18217,11 +18218,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18220: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18221: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18224: \$? = $ac_status" >&5
+   echo "$as_me:18225: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18485,11 +18486,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18488: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18489: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18492: \$? = $ac_status" >&5
+   echo "$as_me:18493: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18589,11 +18590,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18592: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18593: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18596: \$? = $ac_status" >&5
+   echo "$as_me:18597: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -21712,6 +21713,37 @@ _ACEOF
 
 fi
 
+# Check whether --enable-munmap was given.
+if test "${enable_munmap+set}" = set; then
+  enableval=$enable_munmap; MUNMAP_THRESHOLD=$enableval;
+   case "$MMAP" in
+      no)
+        { { echo "$as_me:$LINENO: error: --enable-munmap requires --enable-mmap" >&5
+echo "$as_me: error: --enable-munmap requires --enable-mmap" >&2;}
+   { (exit 1); exit 1; }; }
+        ;;
+    esac
+
+fi
+
+if test "${enable_munmap}" != ""; then
+    cat >>confdefs.h <<\_ACEOF
+#define USE_MMAP 1
+_ACEOF
+
+    cat >>confdefs.h <<\_ACEOF
+#define USE_MUNMAP 1
+_ACEOF
+
+    if test "${MUNMAP_THRESHOLD}" = "yes"; then
+      MUNMAP_THRESHOLD=6
+    fi
+    cat >>confdefs.h <<_ACEOF
+#define MUNMAP_THRESHOLD ${MUNMAP_THRESHOLD}
+_ACEOF
+
+fi
+
 
 
 if test -z "$with_cross_host"; then
index ebe3dea..f34dafd 100644 (file)
@@ -22,7 +22,7 @@ AC_INIT(gc,7.1alpha1,Hans.Boehm@hp.com)
 AC_CONFIG_SRCDIR(gcj_mlc.c)
 AC_CANONICAL_TARGET 
 AC_PREREQ(2.53)
-AC_REVISION($Revision: 1.28 $)
+AC_REVISION($Revision: 1.29 $)
 GC_SET_VERSION
 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc])
 AM_MAINTAINER_MODE
@@ -589,6 +589,25 @@ if test "${enable_gc_assertions}" = yes; then
     AC_DEFINE(GC_ASSERTIONS)
 fi
 
+AC_ARG_ENABLE(munmap,
+    [AC_HELP_STRING([--enable-munmap=N],
+       [return page to the os if empty for N collections])],
+  MUNMAP_THRESHOLD=$enableval;
+   [case "$MMAP" in
+      no)
+        AC_MSG_ERROR([--enable-munmap requires --enable-mmap])
+        ;;
+    esac]
+   )
+if test "${enable_munmap}" != ""; then
+    AC_DEFINE(USE_MMAP)
+    AC_DEFINE(USE_MUNMAP)
+    if test "${MUNMAP_THRESHOLD}" = "yes"; then
+      MUNMAP_THRESHOLD=6
+    fi
+    AC_DEFINE_UNQUOTED(MUNMAP_THRESHOLD, ${MUNMAP_THRESHOLD})
+fi
+
 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
 
 
index c4dc4cd..47cff19 100644 (file)
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -22,9 +22,8 @@ built-in "new" and "delete".
 Authors: John R. Ellis and Jesse Hull
 
 **************************************************************************/
-/* Boehm, December 20, 1994 7:26 pm PST */
 
-#include "gc_cpp.h"
+#include <gc_cpp.h>
 
 void* operator new( size_t size ) {
     return GC_MALLOC_UNCOLLECTABLE( size );}