* Patch: -findirect-classes: Mark class next_or_version field
@ 2006-07-06 18:24 Bryce McKinlay
0 siblings, 0 replies; only message in thread
From: Bryce McKinlay @ 2006-07-06 18:24 UTC (permalink / raw)
To: Java Patches
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
When a class object is created at runtime, eg with -findirect-classes,
but loaded by the bootstrap classloader, the class can be prematurely
collected in the case where there is a hashtable collision in the
bootstrap classloader's loaded_classes table. The solution is to mark
the next_or_version field, which is used as a hashtable chain.
I'm checking this in to trunk.
Bryce
[-- Attachment #2: libjava-bootstrap-class-mark.patch --]
[-- Type: text/x-patch, Size: 676 bytes --]
2006-07-06 Bryce McKinlay <mckinlay@redhat.com>
* boehm.cc (_Jv_MarkObj): Mark the next_or_version field.
Index: boehm.cc
===================================================================
--- boehm.cc (revision 115220)
+++ boehm.cc (working copy)
@@ -167,6 +167,11 @@
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
p = (GC_PTR) c->aux_info;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+ // The class chain must be marked for runtime-allocated Classes
+ // loaded by the bootstrap ClassLoader.
+ p = (GC_PTR) c->next_or_version;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
}
else
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-06 18:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-06 18:24 Patch: -findirect-classes: Mark class next_or_version field Bryce McKinlay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).