Precise GC (was Re: cannot build libjava/gnu/gcj/xlib/natClip.cc)

Jeff Sturm jeff.sturm@appnet.com
Wed Jan 3 13:55:00 GMT 2001


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /