From: hboehm Date: Sat, 31 May 2008 00:40:00 +0000 (+0000) Subject: 2008-05-30 Hans Boehm (some really dmcmahill) X-Git-Tag: gc7_2alpha2~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8e770fd48bbc3ff61a3706c210984bfabee2b33;p=gc 2008-05-30 Hans Boehm (some really dmcmahill) * configure.ac: SPARC fixes. * configure: Regenerate. * thread_local_alloc.c(GC_mark_thread_local_fls_for): Include size 0, except for gcj. * doc/gc.man: Expand C++ cautions. * include/gc_inline.h: Fix comments. --- diff --git a/ChangeLog b/ChangeLog index 75fe3548..918e860b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-30 Hans Boehm (some really dmcmahill) + + * configure.ac: SPARC fixes. + * configure: Regenerate. + * thread_local_alloc.c(GC_mark_thread_local_fls_for): Include + size 0, except for gcj. + * doc/gc.man: Expand C++ cautions. + * include/gc_inline.h: Fix comments. + 2008-05-03 Hans Boehm * include/gc_version.h, configure.ac, doc/README: diff --git a/configure b/configure index 8acc36b6..523eb2b1 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.36 . +# From configure.ac Revision: 1.37 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for gc 7.2alpha1. # @@ -6161,6 +6161,9 @@ _ACEOF sparc-*-netbsd*) machdep="mach_dep.lo sparc_netbsd_mach_dep.lo" ;; + sparc64-*-netbsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" + ;; sparc-sun-solaris2.3) machdep="mach_dep.lo sparc_mach_dep.lo" cat >>confdefs.h <<\_ACEOF @@ -6168,7 +6171,7 @@ _ACEOF _ACEOF ;; - sparc*-sun-solaris2.*) + sparc*-sun-solaris2*) machdep="mach_dep.lo sparc_mach_dep.lo" ;; ia64-*-*) @@ -6872,7 +6875,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6875 "configure"' > conftest.$ac_ext + echo '#line 6878 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9135,11 +9138,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:9138: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9141: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9142: \$? = $ac_status" >&5 + echo "$as_me:9145: \$? = $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. @@ -9403,11 +9406,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:9406: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9409: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9410: \$? = $ac_status" >&5 + echo "$as_me:9413: \$? = $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. @@ -9507,11 +9510,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:9510: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9513: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9514: \$? = $ac_status" >&5 + echo "$as_me:9517: \$? = $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 @@ -11815,7 +11818,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:14261: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14262: \$? = $ac_status" >&5 + echo "$as_me:14265: \$? = $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. @@ -14359,11 +14362,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:14362: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14365: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14366: \$? = $ac_status" >&5 + echo "$as_me:14369: \$? = $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 @@ -15929,11 +15932,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:15932: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15935: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15936: \$? = $ac_status" >&5 + echo "$as_me:15939: \$? = $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. @@ -16033,11 +16036,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:16036: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16039: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16040: \$? = $ac_status" >&5 + echo "$as_me:16043: \$? = $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 @@ -18235,11 +18238,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:18238: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18241: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18242: \$? = $ac_status" >&5 + echo "$as_me:18245: \$? = $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. @@ -18503,11 +18506,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:18506: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18509: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18510: \$? = $ac_status" >&5 + echo "$as_me:18513: \$? = $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. @@ -18607,11 +18610,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:18610: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18613: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18614: \$? = $ac_status" >&5 + echo "$as_me:18617: \$? = $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 diff --git a/configure.ac b/configure.ac index dd99358b..b9b2d5c4 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_INIT(gc,7.2alpha1,Hans.Boehm@hp.com) AC_CONFIG_SRCDIR(gcj_mlc.c) AC_CANONICAL_TARGET AC_PREREQ(2.53) -AC_REVISION($Revision: 1.37 $) +AC_REVISION($Revision: 1.38 $) GC_SET_VERSION AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc]) AM_MAINTAINER_MODE @@ -405,11 +405,14 @@ case "$host" in sparc-*-netbsd*) machdep="mach_dep.lo sparc_netbsd_mach_dep.lo" ;; + sparc64-*-netbsd*) + machdep="mach_dep.lo sparc_mach_dep.lo" + ;; sparc-sun-solaris2.3) machdep="mach_dep.lo sparc_mach_dep.lo" AC_DEFINE(SUNOS53_SHARED_LIB) ;; - sparc*-sun-solaris2.*) + sparc*-sun-solaris2*) machdep="mach_dep.lo sparc_mach_dep.lo" ;; ia64-*-*) diff --git a/doc/gc.man b/doc/gc.man index 2a550c71..109aca6c 100644 --- a/doc/gc.man +++ b/doc/gc.man @@ -30,7 +30,13 @@ instead of calling GC_malloc and friends directly. This allows debugging versions of the routines to be substituted by defining GC_DEBUG before including gc.h. .LP -See the documentation in the include file gc_cpp.h for an alternate, C++ specific interface to the garbage collector. +See the documentation in the include files gc_cpp.h and gc_allocator.h, +as well as the gcinterface.html file in the distribution, +for an alternate, C++ specific interface to the garbage collector. +Note that C++ programs generally +need to be careful to ensure that all allocated memory (whether via new, +malloc, or STL allocators) that may point to garbage collected memory +is either itself garbage collected, or at least traced by the collector. .LP Unlike the standard implementations of malloc, .I diff --git a/include/gc_inline.h b/include/gc_inline.h index ffc5b3ea..2aa314b3 100644 --- a/include/gc_inline.h +++ b/include/gc_inline.h @@ -13,14 +13,16 @@ * modified is included with the above copyright notice. */ -/* USE OF THIS FILE IS NOT RECOMMENDED unless GC_all_interior_pointers */ -/* is not set, or the collector has been built with */ -/* -DDONT_ADD_BYTE_AT_END, or the specified size includes a pointerfree */ -/* word at the end. In the standard collector configuration, */ -/* the final word of each object may not be scanned. */ +/* WARNING: */ +/* Note that for these routines, it is the clients responsibility to */ +/* add the extra byte at the end to deal with one-past-the-end pointers.*/ +/* In the standard collector configuration, the collector assumes that */ +/* such a byte has been added, and hence does not trace the last word */ +/* in the resulting object. */ +/* This is not an issue if the collector is compiled with */ +/* -DDONT_ADD_BYTE_AT_END, or if GC_all_interior_pointers is not set. */ /* This interface is most useful for compilers that generate C. */ -/* It is also used internally for thread-local allocation, in which */ -/* case, the size is suitably adjusted by the caller. */ +/* It is also used internally for thread-local allocation. */ /* Manual use is hereby discouraged. */ #include "gc.h" @@ -45,6 +47,8 @@ /* directly using gmalloc before putting multiple objects into the */ /* tiny_fl entry. If num_direct is zero, then the free lists may also */ /* be initialized to (void *)0. */ +/* Note that we use the zeroth free list to hold objects 1 granule in */ +/* size that are used to satisfy size 0 allocation requests. */ /* We rely on much of this hopefully getting optimized away in the */ /* num_direct = 0 case. */ /* Particularly if granules is constant, this should generate a small */ diff --git a/thread_local_alloc.c b/thread_local_alloc.c index 59881750..d18cd88b 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -291,14 +291,16 @@ void GC_mark_thread_local_fls_for(GC_tlfs p) ptr_t q; int j; - for (j = 1; j < TINY_FREELISTS; ++j) { + for (j = 0; j < TINY_FREELISTS; ++j) { q = p -> ptrfree_freelists[j]; if ((word)q > HBLKSIZE) GC_set_fl_marks(q); q = p -> normal_freelists[j]; if ((word)q > HBLKSIZE) GC_set_fl_marks(q); # ifdef GC_GCJ_SUPPORT - q = p -> gcj_freelists[j]; - if ((word)q > HBLKSIZE) GC_set_fl_marks(q); + if (j > 0) { + q = p -> gcj_freelists[j]; + if ((word)q > HBLKSIZE) GC_set_fl_marks(q); + } # endif /* GC_GCJ_SUPPORT */ } }