This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: GC import
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: FYI: GC import
- From: Tom Tromey <tromey at redhat dot com>
- Date: 17 Aug 2001 19:34:15 -0600
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Reply-To: tromey at redhat dot com
I'm checking in a new version (6.0) of the Boehm GC on the trunk. I'm
not including the patch here. This update required a small change to
libjava/boehm.cc, which I'm appending.
I tested this on x86 Linux.
The Primes.java test now fails, but conversation with Hans indicates
that this is merely bad luck and probably not indicative of an actual
bug.
Many thanks to Hans for writing the boehm.cc patch and for looking
into the Primes failure very quickly.
2001-08-17 Hans-J. Boehm <Hans_Boehm@hp.com>
* boehm.cc: Include gc_local_alloc.h if appropriate.
(GC_GENERIC_MALLOC): Don't define.
(MAYBE_MARK): Redefine for GC 6.0.
(_Jv_MarkObj): Mark class differently.
(_Jv_AllocArray): Use GC_generic_malloc.
Tom
Index: boehm.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/boehm.cc,v
retrieving revision 1.25
diff -u -r1.25 boehm.cc
--- boehm.cc 2001/05/24 05:40:35 1.25
+++ boehm.cc 2001/08/18 00:59:01
@@ -30,24 +30,19 @@
#include <private/gc_pmark.h>
#include <gc_gcj.h>
+#ifdef THREAD_LOCAL_ALLOC
+# define GC_REDIRECT_TO_LOCAL
+# include <gc_local_alloc.h>
+#endif
+
// These aren't declared in any Boehm GC header.
void GC_finalize_all (void);
ptr_t GC_debug_generic_malloc (size_t size, int k, GC_EXTRA_PARAMS);
};
-// FIXME: this should probably be defined in some GC header.
-#ifdef GC_DEBUG
-# define GC_GENERIC_MALLOC(Size, Type) \
- GC_debug_generic_malloc (Size, Type, GC_EXTRAS)
-#else
-# define GC_GENERIC_MALLOC(Size, Type) GC_generic_malloc (Size, Type)
-#endif
-
// We must check for plausibility ourselves.
#define MAYBE_MARK(Obj, Top, Limit, Source, Exit) \
- if ((ptr_t) (Obj) >= GC_least_plausible_heap_addr \
- && (ptr_t) (Obj) <= GC_greatest_plausible_heap_addr) \
- PUSH_CONTENTS (Obj, Top, Limit, Source, Exit)
+ Top=GC_MARK_AND_PUSH((GC_PTR)Obj, Top, Limit, (GC_PTR *)Source)
@@ -312,7 +307,7 @@
# endif
// Mark the object's class.
p = (ptr_t) klass;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o2label);
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, &(dt -> clas), o2label);
for (int i = 0; i < JvGetArrayLength (array); ++i)
{
@@ -374,7 +369,7 @@
if (size < min_heap_addr)
obj = GC_MALLOC(size);
else
- obj = GC_GENERIC_MALLOC (size, array_kind_x);
+ obj = GC_generic_malloc (size, array_kind_x);
#endif
*((_Jv_VTable **) obj) = klass->vtable;
return obj;