[kaffe] CVS kaffe (robilad): merged in boehm-gc 6.7

Kaffe CVS cvs-commits at kaffe.org
Mon Apr 3 13:14:19 PDT 2006


PatchSet 7208 
Date: 2006/04/03 19:59:32
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
merged in boehm-gc 6.7

2006-04-03  Dalibor Topic  <robilad at kaffe.org>

        * THIRDPARTY: Updated to boehm-gc 6.7

        * kaffe/kaffevm/boehm-gc/boehm/ : Updated to boehm-gc 6.7.
        All regression tests pass now with boehm-gc/jit3/pthreads
        on x86-linux.

Members: 
	ChangeLog:1.4715->1.4716 
	THIRDPARTY:1.43->1.44 
	kaffe/kaffevm/boehm-gc/boehm/Makefile.am:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/Makefile.direct:1.3->1.4 
	kaffe/kaffevm/boehm-gc/boehm/Makefile.in:1.11->1.12 
	kaffe/kaffevm/boehm-gc/boehm/allchblk.c:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/alloc.c:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/configure:1.13->1.14 
	kaffe/kaffevm/boehm-gc/boehm/configure.in:1.2->1.3 
	kaffe/kaffevm/boehm-gc/boehm/darwin_stop_world.c:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/dbg_mlc.c:1.2->1.3 
	kaffe/kaffevm/boehm-gc/boehm/dyn_load.c:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/headers.c:1.2->1.3 
	kaffe/kaffevm/boehm-gc/boehm/malloc.c:1.2->1.3 
	kaffe/kaffevm/boehm-gc/boehm/mark.c:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/misc.c:1.3->1.4 
	kaffe/kaffevm/boehm-gc/boehm/os_dep.c:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/powerpc_darwin_mach_dep.s:1.3->1.4 
	kaffe/kaffevm/boehm-gc/boehm/pthread_stop_world.c:1.5->1.6 
	kaffe/kaffevm/boehm-gc/boehm/pthread_support.c:1.5->1.6 
	kaffe/kaffevm/boehm-gc/boehm/threadlibs.c:1.3->1.4 
	kaffe/kaffevm/boehm-gc/boehm/version.h:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/doc/README:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/doc/README.changes:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/doc/gcinterface.html:1.2->1.3 
	kaffe/kaffevm/boehm-gc/boehm/include/gc.h:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/include/gc_config_macros.h:1.3->1.4 
	kaffe/kaffevm/boehm-gc/boehm/include/gc_cpp.h:1.3->1.4 
	kaffe/kaffevm/boehm-gc/boehm/include/gc_pthread_redirects.h:1.1->1.2 
	kaffe/kaffevm/boehm-gc/boehm/include/leak_detector.h:1.1->1.2 
	kaffe/kaffevm/boehm-gc/boehm/include/private/gc_locks.h:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/include/private/gc_pmark.h:1.2->1.3 
	kaffe/kaffevm/boehm-gc/boehm/include/private/gc_priv.h:1.4->1.5 
	kaffe/kaffevm/boehm-gc/boehm/include/private/gcconfig.h:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4715 kaffe/ChangeLog:1.4716
--- kaffe/ChangeLog:1.4715	Mon Apr  3 00:50:23 2006
+++ kaffe/ChangeLog	Mon Apr  3 19:59:32 2006
@@ -1,3 +1,11 @@
+2006-04-03  Dalibor Topic  <robilad at kaffe.org>
+
+	* THIRDPARTY: Updated to boehm-gc 6.7
+
+	* kaffe/kaffevm/boehm-gc/boehm/ : Updated to boehm-gc 6.7.
+	All regression tests pass now with boehm-gc/jit3/pthreads 
+	on x86-linux.
+
 2006-04-02  Dalibor Topic  <robilad at kaffe.org>
 
 	* libraries/javalib/vmspecific/java/lang/reflect/Array.java,
Index: kaffe/THIRDPARTY
diff -u kaffe/THIRDPARTY:1.43 kaffe/THIRDPARTY:1.44
--- kaffe/THIRDPARTY:1.43	Wed Feb  8 02:05:55 2006
+++ kaffe/THIRDPARTY	Mon Apr  3 19:59:39 2006
@@ -603,13 +603,10 @@
 
 * Boem-Weiser garbage collector.
 
-Merged in the Boehm-Weiser garbage collector from
-http://www.hpl.hp.com/personal/Hans_Boehm/gc/. 
-
 Copyright (c) 1988, 1989 Hans-J. Boehm, Alan J. Demers
 Copyright (c) 1991-1996 by Xerox Corporation.  All rights reserved.
 Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
-Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved.
+Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
 
 The file linux_threads.c is also
 Copyright (c) 1998 by Fergus Henderson.  All rights reserved.
@@ -636,8 +633,7 @@
 collector.  (If you are concerned about such things, I recommend you look
 at the notice in config.guess or ltmain.sh.)
 
-This is version 6.3alpha1 of a conservative garbage collector for C and C++.
-
+This is version 6.7 of a conservative garbage collector for C and C++.
 
 * gnu.getopt
 
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.am
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.am:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.am:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.am:1.4	Fri Dec 23 11:42:00 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.am	Mon Apr  3 19:59:42 2006
@@ -95,7 +95,7 @@
 test_cpp_SOURCES = tests/test_cpp.cc
 test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
 
-TESTS = gctest $(extra_checks)
+TESTS = $(check_PROGRAMS)
 
 ## FIXME: relies on internal code generated by automake.
 all_objs = @addobjs@ $(libgc_la_OBJECTS)
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.direct
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.direct:1.3 kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.direct:1.4
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.direct:1.3	Fri Dec 23 11:42:00 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.direct	Mon Apr  3 19:59:43 2006
@@ -144,9 +144,9 @@
 # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of
 #   order by specifying a nonstandard finalization mark procedure  (see
 #   finalize.c).  Objects reachable from finalizable objects will be marked
-#   in a sepearte postpass, and hence their memory won't be reclaimed.
+#   in a separate postpass, and hence their memory won't be reclaimed.
 #   Not recommended unless you are implementing a language that specifies
-#   these semantics.  Since 5.0, determines only only the initial value
+#   these semantics.  Since 5.0, determines only the initial value
 #   of GC_java_finalization variable.
 # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response
 #   to explicit GC_invoke_finalizers() calls.
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.in
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.in:1.11 kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.in:1.12
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.in:1.11	Fri Dec 23 18:00:45 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/Makefile.in	Mon Apr  3 19:59:43 2006
@@ -357,7 +357,7 @@
 gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
 test_cpp_SOURCES = tests/test_cpp.cc
 test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-TESTS = gctest $(extra_checks)
+TESTS = $(check_PROGRAMS)
 all_objs = @addobjs@ $(libgc_la_OBJECTS)
 @COMPILER_XLC_FALSE at ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
 @COMPILER_XLC_TRUE at ASM_CPP_OPTIONS = 
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/allchblk.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/allchblk.c:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/allchblk.c:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/allchblk.c:1.4	Fri Dec 23 11:42:00 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/allchblk.c	Mon Apr  3 19:59:43 2006
@@ -529,7 +529,7 @@
 				/* free blocks in GC_add_to_fl.		*/
 #     endif
 #   ifdef USE_MUNMAP
-      hhdr -> hb_last_reclaimed = GC_gc_no;
+      hhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
 #   endif
     hhdr -> hb_sz = h_size;
     GC_add_to_fl(h, hhdr);
@@ -793,7 +793,7 @@
     GC_remove_counts(hbp, (word)size);
     hhdr->hb_sz = size;
 #   ifdef USE_MUNMAP
-      hhdr -> hb_last_reclaimed = GC_gc_no;
+      hhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
 #   endif
     
     /* Check for duplicate deallocation in the easy case */
@@ -821,7 +821,7 @@
 	  GC_remove_from_fl(prevhdr, FL_UNKNOWN);
 	  prevhdr -> hb_sz += hhdr -> hb_sz;
 #	  ifdef USE_MUNMAP
-	    prevhdr -> hb_last_reclaimed = GC_gc_no;
+	    prevhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
 #	  endif
 	  GC_remove_header(hbp);
 	  hbp = prev;
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/alloc.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/alloc.c:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/alloc.c:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/alloc.c:1.4	Fri Dec 23 11:42:00 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/alloc.c	Mon Apr  3 19:59:43 2006
@@ -206,7 +206,7 @@
     	/* had been reallocated this round. Finalization is user	*/
     	/* visible progress.  And if we don't count this, we have	*/
     	/* stability problems for programs that finalize all objects.	*/
-    if ((GC_words_wasted >> 3) < result)
+    if ((signed_word)(GC_words_wasted >> 3) < result)
         result += GC_words_wasted;
      	/* This doesn't reflect useful work.  But if there is lots of	*/
      	/* new fragmentation, the same is probably true of the heap,	*/
@@ -402,7 +402,7 @@
 /*
  * Perform n units of garbage collection work.  A unit is intended to touch
  * roughly GC_RATE pages.  Every once in a while, we do more than that.
- * This needa to be a fairly large number with our current incremental
+ * This needs to be a fairly large number with our current incremental
  * GC strategy, since otherwise we allocate too much during GC, and the
  * cleanup gets expensive.
  */
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/configure
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/configure:1.13 kaffe/kaffe/kaffevm/boehm-gc/boehm/configure:1.14
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/configure:1.13	Thu Mar 23 23:25:04 2006
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/configure	Mon Apr  3 19:59:43 2006
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.ac Revision: 1.5 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for gc 6.6.
+# Generated by GNU Autoconf 2.59 for gc 6.7.
 #
 # Report bugs to <Hans.Boehm at hp.com>.
 #
@@ -429,8 +429,8 @@
 # Identity of this package.
 PACKAGE_NAME='gc'
 PACKAGE_TARNAME='gc'
-PACKAGE_VERSION='6.6'
-PACKAGE_STRING='gc 6.6'
+PACKAGE_VERSION='6.7'
+PACKAGE_STRING='gc 6.7'
 PACKAGE_BUGREPORT='Hans.Boehm at hp.com'
 
 ac_unique_file="gcj_mlc.c"
@@ -956,7 +956,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gc 6.6 to adapt to many kinds of systems.
+\`configure' configures gc 6.7 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1023,7 +1023,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gc 6.6:";;
+     short | recursive ) echo "Configuration of gc 6.7:";;
    esac
   cat <<\_ACEOF
 
@@ -1167,7 +1167,7 @@
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-gc configure 6.6
+gc configure 6.7
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1181,7 +1181,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gc $as_me 6.6, which was
+It was created by gc $as_me 6.7, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1953,7 +1953,7 @@
 
 # Define the identity of the package.
  PACKAGE='gc'
- VERSION='6.6'
+ VERSION='6.7'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4051,6 +4051,23 @@
 	INCLUDES="$INCLUDES -pthread"
 	THREADDLLIBS=-pthread
       	;;
+     *-*-netbsd*)
+	{ echo "$as_me:$LINENO: WARNING: \"Only on NetBSD 2.0 or later.\"" >&5
+echo "$as_me: WARNING: \"Only on NetBSD 2.0 or later.\"" >&2;}
+	cat >>confdefs.h <<\_ACEOF
+#define GC_NETBSD_THREADS 1
+_ACEOF
+
+	cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
+
+	cat >>confdefs.h <<\_ACEOF
+#define _PTHREADS 1
+_ACEOF
+
+	THREADDLLIBS="-lpthread -lrt"
+	;;
      *-*-solaris*)
 	cat >>confdefs.h <<\_ACEOF
 #define GC_SOLARIS_THREADS 1
@@ -10300,7 +10317,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by gc $as_me 6.6, which was
+This file was extended by gc $as_me 6.7, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10358,7 +10375,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-gc config.status 6.6
+gc config.status 6.7
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/configure.in
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/configure.in:1.2 kaffe/kaffe/kaffevm/boehm-gc/boehm/configure.in:1.3
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/configure.in:1.2	Fri Dec 23 11:42:01 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/configure.in	Mon Apr  3 19:59:43 2006
@@ -17,12 +17,12 @@
 # Initialization
 # ==============
 
-AC_INIT(gc,6.6,Hans.Boehm at hp.com) 
+AC_INIT(gc,6.7,Hans.Boehm at hp.com) 
     ## version must conform to [0-9]+[.][0-9]+(alpha[0-9]+)?
 AC_CONFIG_SRCDIR(gcj_mlc.c)
 AC_CANONICAL_TARGET 
 AC_PREREQ(2.53)
-AC_REVISION($Revision: 1.2 $)
+AC_REVISION($Revision: 1.3 $)
 GC_SET_VERSION
 AM_INIT_AUTOMAKE
 
@@ -110,6 +110,13 @@
 	INCLUDES="$INCLUDES -pthread"
 	THREADDLLIBS=-pthread
       	;;
+     *-*-netbsd*)
+	AC_MSG_WARN("Only on NetBSD 2.0 or later.")
+	AC_DEFINE(GC_NETBSD_THREADS)
+	AC_DEFINE(_REENTRANT)
+	AC_DEFINE(_PTHREADS)
+	THREADDLLIBS="-lpthread -lrt"
+	;;
      *-*-solaris*)
 	AC_DEFINE(GC_SOLARIS_THREADS)
 	AC_DEFINE(GC_SOLARIS_PTHREADS)
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/darwin_stop_world.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/darwin_stop_world.c:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/darwin_stop_world.c:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/darwin_stop_world.c:1.4	Fri Dec 23 11:42:01 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/darwin_stop_world.c	Mon Apr  3 19:59:43 2006
@@ -1,5 +1,7 @@
 #include "private/pthread_support.h"
 
+/* This probably needs more porting work to ppc64. */
+
 # if defined(GC_DARWIN_THREADS)
 
 /* From "Inside Mac OS X - Mach-O Runtime Architecture" published by Apple
@@ -36,7 +38,7 @@
 #   if CPP_WORDSZ == 32
       __asm__ volatile("lwz	%0,0(r1)" : "=r" (frame));
 #   else
-      __asm__ volatile("ldz	%0,0(r1)" : "=r" (frame));
+      __asm__ volatile("ld	%0,0(r1)" : "=r" (frame));
 #   endif
 # endif
   } else {
@@ -73,7 +75,13 @@
   GC_thread p;
   pthread_t me;
   ptr_t lo, hi;
+#if defined(POWERPC)
   ppc_thread_state_t state;
+#elif defined(I386)
+  i386_thread_state_t state;
+#else
+# error FIXME for non-x86 || ppc architectures
+#endif
   mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
   
   me = pthread_self();
@@ -93,6 +101,17 @@
 			     &thread_state_count);
 	if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
 	
+#if defined(I386)
+	lo = state.esp;
+
+	GC_push_one(state.eax); 
+	GC_push_one(state.ebx); 
+	GC_push_one(state.ecx); 
+	GC_push_one(state.edx); 
+	GC_push_one(state.edi); 
+	GC_push_one(state.esi); 
+	GC_push_one(state.ebp); 
+#elif defined(POWERPC)
 	lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
         
 	GC_push_one(state.r0); 
@@ -126,6 +145,9 @@
 	GC_push_one(state.r29); 
 	GC_push_one(state.r30); 
 	GC_push_one(state.r31);
+#else
+# error FIXME for non-x86 || ppc architectures
+#endif
       } /* p != me */
       if(p->flags & MAIN_THREAD)
 	hi = GC_stackbottom;
@@ -247,6 +269,7 @@
 #     endif
       GC_push_all_stack(lo, hi); 
     } /* for(p=GC_threads[i]...) */
+    vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
 }
 #endif /* !DARWIN_DONT_PARSE_STACK */
 
@@ -390,6 +413,7 @@
 	changes = result;
 	prev_list = act_list;
 	prevcount = listcount;
+        vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
       } while (changes);
       
  
@@ -461,6 +485,7 @@
 	}
       }
     }
+    vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
 #   if DEBUG_THREADS
      GC_printf0("World started\n");
 #   endif
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/dbg_mlc.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/dbg_mlc.c:1.2 kaffe/kaffe/kaffevm/boehm-gc/boehm/dbg_mlc.c:1.3
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/dbg_mlc.c:1.2	Mon Aug  2 10:44:57 2004
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/dbg_mlc.c	Mon Apr  3 19:59:43 2006
@@ -14,6 +14,8 @@
  * modified is included with the above copyright notice.
  */
 
+#include <errno.h>
+#include <string.h>
 #include "private/dbg_mlc.h"
 
 void GC_default_print_heap_obj_proc();
@@ -711,6 +713,26 @@
     }
     ADD_CALL_CHAIN(result, ra);
     return (GC_store_debug_info(result, (word)lb, s, (word)i));
+}
+
+# ifdef __STDC__
+    char *GC_debug_strdup(const char *str, GC_EXTRA_PARAMS)
+#else
+    char *GC_debug_strdup(str, s, i)
+    char *str;
+    char *s;
+    int i;
+#endif
+{
+    char *copy;
+    if (str == NULL) return NULL;
+    copy = GC_debug_malloc_atomic(strlen(str) + 1, OPT_RA s, i);
+    if (copy == NULL) {
+      errno = ENOMEM;
+      return NULL;
+    }
+    strcpy(copy, str);
+    return copy;
 }
 
 # ifdef __STDC__
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/dyn_load.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/dyn_load.c:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/dyn_load.c:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/dyn_load.c:1.4	Fri Dec 23 11:42:01 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/dyn_load.c	Mon Apr  3 19:59:43 2006
@@ -776,8 +776,8 @@
   /* this automatically, and rely largely on user input.	*/
   /* We expect that any mapping with type MEM_MAPPED (which 	*/
   /* apparently excludes library data sections) can be safely	*/
-  /* ignored.  But we're too chicken to do that in this 	*/
-  /* version.							*/
+  /* ignored.  But we're too completely remove this code in	*/
+  /* this version.						*/
   /* Based on a very limited sample, it appears that:		*/
   /* 	- Frame buffer mappings appear as mappings of large	*/
   /*	  length, usually a bit less than a power of two.	*/
@@ -844,6 +844,9 @@
   }
 # endif /* DEBUG_VIRTUALQUERY */
 
+  extern GC_bool GC_wnt;  /* Is Windows NT derivative.		*/
+  			  /* Defined and set in os_dep.c.	*/
+
   void GC_register_dynamic_libraries()
   {
     MEMORY_BASIC_INFORMATION buf;
@@ -885,7 +888,12 @@
 		 * !is_frame_buffer(p, buf.RegionSize, buf.Type)
 		 * instead of just checking for MEM_IMAGE.
 		 * If something breaks, change it back. */
-		&& buf.Type == MEM_IMAGE) {  
+		/* There is some evidence that we cannot always
+		 * ignore MEM_PRIVATE sections under Windows ME
+		 * and predecessors.  Hence we now also check for
+		 * that case.	*/
+		&& (buf.Type == MEM_IMAGE ||
+		    !GC_wnt && buf.Type == MEM_PRIVATE)) {  
 #	        ifdef DEBUG_VIRTUALQUERY
 	          GC_dump_meminfo(&buf);
 #	        endif
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/headers.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/headers.c:1.2 kaffe/kaffe/kaffevm/boehm-gc/boehm/headers.c:1.3
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/headers.c:1.2	Mon Aug  2 10:44:57 2004
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/headers.c	Mon Apr  3 19:59:44 2006
@@ -210,7 +210,7 @@
     result = alloc_hdr();
     SET_HDR(h, result);
 #   ifdef USE_MUNMAP
-	result -> hb_last_reclaimed = GC_gc_no;
+	result -> hb_last_reclaimed = (unsigned short)GC_gc_no;
 #   endif
     return(result);
 }
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/malloc.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/malloc.c:1.2 kaffe/kaffe/kaffevm/boehm-gc/boehm/malloc.c:1.3
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/malloc.c:1.2	Mon Aug  2 10:44:57 2004
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/malloc.c	Mon Apr  3 19:59:44 2006
@@ -15,6 +15,8 @@
 /* Boehm, February 7, 1996 4:32 pm PST */
  
 #include <stdio.h>
+#include <string.h>
+#include <errno.h>
 #include "private/gc_priv.h"
 
 extern ptr_t GC_clear_stack();	/* in misc.c, behaves like identity */
@@ -271,6 +273,26 @@
    }
 }
 
+/* provide a version of strdup() that uses the collector to allocate the
+   copy of the string */
+# ifdef __STDC__
+    char *GC_strdup(const char *s)
+# else
+    char *GC_strdup(s)
+    char *s;
+#endif
+{
+  char *copy;
+
+  if (s == NULL) return NULL;
+  if ((copy = GC_malloc_atomic(strlen(s) + 1)) == NULL) {
+    errno = ENOMEM;
+    return NULL;
+  }
+  strcpy(copy, s);
+  return copy;
+}
+
 /* Allocate lb bytes of composite (pointerful) data */
 # ifdef __STDC__
     GC_PTR GC_malloc(size_t lb)
@@ -370,6 +392,10 @@
   {
     size_t len = strlen(s) + 1;
     char * result = ((char *)REDIRECT_MALLOC(len+1));
+    if (result == 0) {
+      errno = ENOMEM;
+      return 0;
+    }
     BCOPY(s, result, len+1);
     return result;
   }
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/mark.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/mark.c:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/mark.c:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/mark.c:1.4	Fri Dec 23 11:42:01 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/mark.c	Mon Apr  3 19:59:44 2006
@@ -1486,7 +1486,6 @@
 ptr_t cold_gc_frame;
 {
   if (!NEED_FIXUP_POINTER && GC_all_interior_pointers) {
-#   define EAGER_BYTES 1024
     /* Push the hot end of the stack eagerly, so that register values   */
     /* saved inside GC frames are marked before they disappear.		*/
     /* The rest of the marking can be deferred until later.		*/
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/misc.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/misc.c:1.3 kaffe/kaffe/kaffevm/boehm-gc/boehm/misc.c:1.4
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/misc.c:1.3	Fri May  6 17:02:54 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/misc.c	Mon Apr  3 19:59:44 2006
@@ -34,6 +34,10 @@
 # include <tchar.h>
 #endif
 
+#ifdef NONSTOP
+# include <floss.h>
+#endif
+
 # ifdef THREADS
 #   ifdef PCR
 #     include "il/PCR_IL.h"
@@ -477,10 +481,11 @@
 #if defined(GC_WIN32_THREADS) && !defined(GC_PTHREADS)
     if (!GC_is_initialized) {
       BOOL (WINAPI *pfn) (LPCRITICAL_SECTION, DWORD) = NULL;
-      HMODULE hK32 = GetModuleHandle("kernel32.dll");
+      HMODULE hK32 = GetModuleHandleA("kernel32.dll");
       if (hK32)
-          (FARPROC) pfn = GetProcAddress(hK32,
-			  "InitializeCriticalSectionAndSpinCount");
+	  pfn = (BOOL (WINAPI *) (LPCRITICAL_SECTION, DWORD))
+		GetProcAddress (hK32,
+				"InitializeCriticalSectionAndSpinCount");
       if (pfn)
           pfn(&GC_allocate_ml, 4000);
       else
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/os_dep.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/os_dep.c:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/os_dep.c:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/os_dep.c:1.4	Fri Dec 23 11:42:01 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/os_dep.c	Mon Apr  3 19:59:44 2006
@@ -1181,12 +1181,15 @@
   	/* This used to be set for gcc, to avoid dealing with		*/
   	/* the structured exception handling issues.  But we now have	*/
   	/* assembly code to do that right.				*/
+  GC_bool GC_wnt = FALSE;
+        /* This is a Windows NT derivative, i.e. NT, W2K, XP or later.  */
   
   void GC_init_win32()
   {
     /* if we're running under win32s, assume that no DLLs will be loaded */
     DWORD v = GetVersion();
-    GC_no_win32_dlls |= ((v & 0x80000000) && (v & 0xff) <= 3);
+    GC_wnt = !(v & 0x80000000);
+    GC_no_win32_dlls |= ((!GC_wnt) && (v & 0xff) <= 3);
   }
 
   /* Return the smallest address a such that VirtualQuery		*/
@@ -1498,7 +1501,7 @@
 
 # if !defined(OS2) && !defined(PCR) && !defined(AMIGA) \
 	&& !defined(MSWIN32) && !defined(MSWINCE) \
-	&& !defined(MACOS) && !defined(DOS4GW)
+	&& !defined(MACOS) && !defined(DOS4GW) && !defined(NONSTOP)
 
 # ifdef SUNOS4
     extern caddr_t sbrk();
@@ -3799,8 +3802,12 @@
         mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
         ppc_exception_state64_t exc_state;
 #     endif
+#   elif defined(I386)
+        thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
+        mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
+        i386_exception_state_t exc_state;
 #   else
-#	error FIXME for non-ppc darwin
+#	error FIXME for non-ppc/x86 darwin
 #   endif
 
     
@@ -3830,7 +3837,13 @@
     }
     
     /* This is the address that caused the fault */
+#if defined(POWERPC)
     addr = (char*) exc_state.dar;
+#elif defined (I386)
+    addr = (char*) exc_state.faultvaddr;
+#else
+#   error FIXME for non POWERPC/I386
+#endif
         
     if((HDR(addr)) == 0) {
         /* Ugh... just like the SIGBUS problem above, it seems we get a bogus 
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/powerpc_darwin_mach_dep.s
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/powerpc_darwin_mach_dep.s:1.3 kaffe/kaffe/kaffevm/boehm-gc/boehm/powerpc_darwin_mach_dep.s:1.4
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/powerpc_darwin_mach_dep.s:1.3	Fri Dec 23 11:42:02 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/powerpc_darwin_mach_dep.s	Mon Apr  3 19:59:44 2006
@@ -1,10 +1,21 @@
+#if defined(__ppc64__)
+#define MODE_CHOICE(x, y) y
+#else
+#define MODE_CHOICE(x, y) x
+#endif
+
+#define lgu     MODE_CHOICE(lwzu, ldu)
+
+#define g_long  MODE_CHOICE(long, quad)         /* usage is ".g_long" */
+
+#define LOG2_GPR_BYTES  MODE_CHOICE(2,3)        /* log2(GPR_BYTES) */
 
 ; GC_push_regs function. Under some optimization levels GCC will clobber
 ; some of the non-volatile registers before we get a chance to save them
 ; therefore, this cannot be inline asm.
 
 .text
-	.align 2
+	.align LOG2_GPR_BYTES
 	.globl _GC_push_regs
 _GC_push_regs:
     
@@ -65,7 +76,7 @@
 
 .data
 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-	.align 2
+	.align LOG2_GPR_BYTES
 L_GC_push_one$stub:
 	.indirect_symbol _GC_push_one
 	mflr r0
@@ -74,12 +85,11 @@
 	mflr r11
 	addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
 	mtlr r0
-	lwzu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
+	lgu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
 	mtctr r12
 	bctr
 .data
 .lazy_symbol_pointer
 L_GC_push_one$lazy_ptr:
 	.indirect_symbol _GC_push_one
-	.long dyld_stub_binding_helper
-
+	.g_long dyld_stub_binding_helper
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_stop_world.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_stop_world.c:1.5 kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_stop_world.c:1.6
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_stop_world.c:1.5	Fri Dec 23 11:42:02 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_stop_world.c	Mon Apr  3 19:59:44 2006
@@ -107,7 +107,7 @@
  */
 
 #ifndef SIG_THR_RESTART
-#  if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
+#  if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || defined(GC_NETBSD_THREADS)
 #    ifdef _SIGRTMIN
 #      define SIG_THR_RESTART _SIGRTMIN + 5
 #    else
@@ -120,6 +120,13 @@
 
 sem_t GC_suspend_ack_sem;
 
+#ifdef GC_NETBSD_THREADS
+# define GC_NETBSD_THREADS_WORKAROUND
+  /* It seems to be necessary to wait until threads have restarted.	*/
+  /* But it is unclear why that is the case.				*/
+  sem_t GC_restart_ack_sem;
+#endif
+
 void GC_suspend_handler_inner(ptr_t sig_arg);
 
 #if defined(IA64) || defined(HP_PA)
@@ -227,6 +234,10 @@
 
     if (sig != SIG_THR_RESTART) ABORT("Bad signal in suspend_handler");
 
+#ifdef GC_NETBSD_THREADS_WORKAROUND
+    sem_post(&GC_restart_ack_sem);
+#endif
+
     /*
     ** Note: even if we don't do anything useful here,
     ** it would still be necessary to have a signal handler,
@@ -303,6 +314,8 @@
 		(unsigned long) bs_lo, (unsigned long) bs_hi);
 #	  endif
           if (pthread_equal(p -> id, me)) {
+	    /* FIXME:  This may add an unbounded number of entries,	*/
+	    /* and hence overflow the mark stack, which is bad.		*/
 	    GC_push_all_eager(bs_lo, bs_hi);
 	  } else {
 	    GC_push_all_stack(bs_lo, bs_hi);
@@ -439,6 +452,9 @@
     register GC_thread p;
     register int n_live_threads = 0;
     register int result;
+#ifdef GC_NETBSD_THREADS_WORKAROUND
+    int code;
+#endif
 
 #   if DEBUG_THREADS
       GC_printf0("World starting\n");
@@ -468,6 +484,14 @@
         }
       }
     }
+#ifdef GC_NETBSD_THREADS_WORKAROUND
+    for (i = 0; i < n_live_threads; i++)
+	while (0 != (code = sem_wait(&GC_restart_ack_sem)))
+	    if (errno != EINTR) {
+		GC_err_printf1("sem_wait() returned %ld\n", (unsigned long)code);
+		ABORT("sem_wait() for restart handler failed");
+	    }
+#endif
     #if DEBUG_THREADS
       GC_printf0("World started\n");
     #endif
@@ -478,6 +502,10 @@
     
     if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
         ABORT("sem_init failed");
+#ifdef GC_NETBSD_THREADS_WORKAROUND
+    if (sem_init(&GC_restart_ack_sem, 0, 0) != 0)
+	ABORT("sem_init failed");
+#endif
 
     act.sa_flags = SA_RESTART;
     if (sigfillset(&act.sa_mask) != 0) {
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_support.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_support.c:1.5 kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_support.c:1.6
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_support.c:1.5	Fri Dec 23 11:42:02 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/pthread_support.c	Mon Apr  3 19:59:44 2006
@@ -67,7 +67,8 @@
 # endif
 
 # if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
-      defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \
+      defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) || \
+      defined(GC_NETBSD_THREADS))			       \
       && !defined(USE_PTHREAD_SPECIFIC)
 #   define USE_PTHREAD_SPECIFIC
 # endif
@@ -120,7 +121,10 @@
 # include <sys/sysctl.h>
 #endif /* GC_DARWIN_THREADS */
 
-
+#if defined(GC_NETBSD_THREADS)
+# include <sys/param.h>
+# include <sys/sysctl.h>
+#endif	/* GC_NETBSD_THREADS */
 
 #if defined(GC_DGUX386_THREADS)
 # include <sys/dg_sys_info.h>
@@ -836,6 +840,18 @@
 }
 #endif /* GC_DGUX386_THREADS */
 
+#if defined(GC_NETBSD_THREADS)
+static int get_ncpu(void)
+{
+    int mib[] = {CTL_HW,HW_NCPU};
+    int res;
+    size_t len = sizeof(res);
+
+    sysctl(mib, sizeof(mib)/sizeof(int), &res, &len, NULL, 0);
+    return res;
+}
+#endif	/* GC_NETBSD_THREADS */
+
 /* We hold the allocation lock.	*/
 void GC_thr_init()
 {
@@ -880,6 +896,9 @@
 #       if defined(GC_IRIX_THREADS)
 	  GC_nprocs = sysconf(_SC_NPROC_ONLN);
 	  if (GC_nprocs <= 0) GC_nprocs = 1;
+#       endif
+#       if defined(GC_NETBSD_THREADS)
+	  GC_nprocs = get_ncpu();
 #       endif
 #       if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS)
 	  int ncpus = 1;
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/threadlibs.c
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/threadlibs.c:1.3 kaffe/kaffe/kaffevm/boehm-gc/boehm/threadlibs.c:1.4
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/threadlibs.c:1.3	Fri May  6 17:02:55 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/threadlibs.c	Mon Apr  3 19:59:44 2006
@@ -22,6 +22,10 @@
           printf("-pthread\n");
 #       endif
 #   endif
+#   if defined(GC_NETBSD_THREADS)
+	  printf("-lpthread -lrt\n");
+#   endif
+
 #   if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
 	printf("-lpthread -lrt\n");
 #   endif
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/version.h
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/version.h:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/version.h:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/version.h:1.4	Fri Dec 23 11:42:02 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/version.h	Mon Apr  3 19:59:44 2006
@@ -2,7 +2,7 @@
 /* Eventually this one may become unnecessary.  For now we need	*/
 /* it to keep the old-style build process working.		*/
 #define GC_TMP_VERSION_MAJOR 6
-#define GC_TMP_VERSION_MINOR 6
+#define GC_TMP_VERSION_MINOR 7
 #define GC_TMP_ALPHA_VERSION GC_NOT_ALPHA
 
 #ifndef GC_NOT_ALPHA
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README:1.4	Fri Dec 23 11:42:02 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README	Mon Apr  3 19:59:44 2006
@@ -28,7 +28,7 @@
 collector.  (If you are concerned about such things, I recommend you look
 at the notice in config.guess or ltmain.sh.)
 
-This is version 6.6 of a conservative garbage collector for C and C++.
+This is version 6.7 of a conservative garbage collector for C and C++.
 
 You might find a more recent version of this at
 
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README.changes
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README.changes:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README.changes:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README.changes:1.4	Fri Dec 23 11:42:02 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/README.changes	Mon Apr  3 19:59:45 2006
@@ -2245,6 +2245,45 @@
    to Ben Hutchings for the observation and patch.)
  - Move up struct callinfo declaration to make gcc 4.0.2. happy.
 
+Since 6.6:
+ - Add "int" to Solaris "end" and "etext" declaration in gc.h.  Declared
+   the symbols with underscores and as arrays, since that's what's actually
+   used.  Perhaps this could all just be removed?  (Thanks to John Bowman.)
+ - Fixed ARM GC_test_and_set code.  (Thanks to Kazu Hirata and Paul Brook.)
+ - Added casts for assignments to hb_last_reclaimed, which truncate the
+   value.  Added a cast to GC_adj_words_allocd.  Use GetModuleHandleA
+   when retrieving a handle to kernel32.dll under win32.  (Thanks to the
+   Visual Prolog developers.)
+ - Added Tandem S-Series support.  (Thanks to Craig McDaniel.  A modified
+   version of his patch was applied, and hence breakage is probably not
+   his fault.)
+ - Remove spurious gc:: qualifier for operator delete[] in gc_cpp.h.
+   (Thanks to Hanno Boeck.)
+ - Changed a test for LINUX in config_macros.h to one for __linux__.
+ - Fix ppc 64 test_and_set code by removing it.  (Thanks to Christian
+   Thalinger.)
+ - Add prototypes for GC_finalizer_notifier and GC_thr_init.  (Thanks to
+   David Ayers.)
+ - Use ld instead of nonexistent ldz instruction in Darwin FindTopOfStack.
+   (Thanks to Andreas Tobler.)
+ - Add support for Darwin/X86.  (Thanks to Geoff Norton and the Mono
+   developers.)
+ - Merge in some recent gcc fixes.  Add ppc64 asm code.  (Thanks to Bryce
+   McKinley and other gcj developers.)
+ - Scan MEM_PRIVATE sections under Windows ME and predecessors.
+ - Interior pointers with some largish offsets into large objects could
+   be ignored, if GC_all_interior_pointers was set.  (Oddly this worked
+   correctly for stack references if it was not set.  Otherwise it failed
+   for both stack and heap references.)  Thanks to Andrew McKinlay for the
+   critical test case.
+ - Integrated Tatsuya Bizenn's NETBSD threads support, with some
+   minimally tested changes.
+ - Added GC_strdup and friends to make leak detection work correctly
+   for strdup clients.  (Thanks to Jon Moore.)  Fixed the existing strdup
+   with malloc redirection to handle a null malloc return correctly.
+ - Fix Makefile.am, so it handles exe extensions under Cygwin correctly
+   for gctest.
+
 To do:
  - The USE_MUNMAP code should really use a separate data structure
    indexed by physical page to keep track of time since last use of
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/gcinterface.html
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/gcinterface.html:1.2 kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/gcinterface.html:1.3
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/gcinterface.html:1.2	Mon Aug  2 10:45:00 2004
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/doc/gcinterface.html	Mon Apr  3 19:59:45 2006
@@ -34,6 +34,12 @@
 The header file <TT>gc.h</tt> must be included
 in files that use either GC or threads primitives, since threads primitives
 will be redefined to cooperate with the GC on many platforms.
+<P>
+Thread users should also be aware that on many platforms objects reachable
+only from thread-local variables may be prematurely reclaimed.
+Thus objects pointed to by thread-local variables should also be pointed to
+by a globally visible data structure.  (This is viewed as a bug, but as
+one that is exceedingly hard to fix without some libc hooks.)
 <DL>
 <DT> <B>void * GC_MALLOC(size_t <I>nbytes</i>)</b>
 <DD>
@@ -179,6 +185,11 @@
 but are scanned for pointers to collectable objects.
 They are allocated by <TT>GC_MALLOC_UNCOLLECTABLE</tt>, as described
 above, and through some interfaces described below.
+<P>
+(On most platforms, the collector may not trace correctly from in-flight
+exception objects.  Thus objects thrown as exceptions should only
+point to otherwise reachable memory.  This is another bug whose
+proper repair requires platform hooks.)
 <P>
 The easiest way to ensure that collectable objects are properly referenced
 is to allocate only collectable objects.  This requires that every
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/include/gc.h
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/include/gc.h:1.4 kaffe/kaffe/kaffevm/boehm-gc/boehm/include/gc.h:1.5
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/include/gc.h:1.4	Fri Dec 23 11:42:03 2005
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/include/gc.h	Mon Apr  3 19:59:45 2006
@@ -129,7 +129,7 @@
 			/* ordered finalization.  Default value is	*/
 			/* determined by JAVA_FINALIZATION macro.	*/
 
-GC_API void (* GC_finalizer_notifier)();
+GC_API void (* GC_finalizer_notifier) GC_PROTO((void));
 			/* Invoked by the collector when there are 	*/
 			/* objects to be finalized.  Invoked at most	*/
 			/* once per GC cycle.  Never invoked unless 	*/
@@ -267,6 +267,7 @@
  */
 GC_API GC_PTR GC_malloc GC_PROTO((size_t size_in_bytes));
 GC_API GC_PTR GC_malloc_atomic GC_PROTO((size_t size_in_bytes));
+GC_API char *GC_strdup GC_PROTO((const char *str));
 GC_API GC_PTR GC_malloc_uncollectable GC_PROTO((size_t size_in_bytes));
 GC_API GC_PTR GC_malloc_stubborn GC_PROTO((size_t size_in_bytes));
 
@@ -523,6 +524,8 @@
 	GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS));
 GC_API GC_PTR GC_debug_malloc_atomic
 	GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS));

*** Patch too long, truncated ***




More information about the kaffe mailing list