JNI global refs

Jeff Sturm jsturm@one-point.com
Thu Jun 28 14:31:00 GMT 2001


On 28 Jun 2001, Marcus G. Daniels wrote:
> Tom> However, I don't understand your proposed change. Where would we put
> Tom> the GC_malloc_uncollectable?
>> If I'm right, that would mean making sure anything returned from
> NewGlobalRef was nailed down once and for all. Given that a localRef
> and a globalRef are the same pointer, that would mean changing some
> things in jni.cc...

I suspect the problem is with using a Hashtable. Suppose we have a class:
class WillBreakJNI {
 public int hashCode() { return 0; }
 public boolean equals(Object o) { return true; }
}
The ref_table will store only one instance of this class.
I think ref_table should hash its objects by address, or something...
Jeff


More information about the Java mailing list

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