This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: JNI global refs
- To: "Marcus G. Daniels" <mgd at swarm dot org>
- Subject: Re: JNI global refs
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Thu, 28 Jun 2001 17:42:42 -0400 (EDT)
- cc: tromey at redhat dot com, java at gcc dot gnu dot org
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