This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: Precise GC (was Re: cannot build libjava/gnu/gcj/xlib/natClip.cc)
Per Bothner wrote:
> void foo (jobject x)
> {
> struct {
> jobject x;
> jobject y;
> jstring z;
> } p;
> _Jv_RegisterPointers(&p, sizeof(*p));
> try {
> p.x = x;
> p.y = ...;
> p.z = ...;
> } finally { _Jv_UnRegisterPointers(&p, sizeof(*p))' }
> }
>
> _Jv_RegisterPointers add the pointers to the root set (after zeroing
> them); _Jv_UnRegisterPointers removes them from the root set.
It seems to me this is unsafe for precise marking if a collection can be invoked
asynchronously after _Jv_RegisterPointers() and before p is initialized.
Method arguments are not explicitly registered by this scheme either. (And they
could live in registers, for that matter.)
--
Jeff Sturm
jeff.sturm@commerceone.com