This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: JNI global refs
- To: tromey at redhat dot com
- Subject: Re: JNI global refs
- From: Cedric Berger <cedric at wireless-networks dot com>
- Date: Tue, 24 Jul 2001 11:47:56 -0700
- CC: Jeff Sturm <jsturm at one-point dot com>, "Marcus G. Daniels" <mgd at swarm dot org>, java at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10106281733590.18528-100000@mars.deadcafe.org> <87zo9u17w4.fsf@creche.redhat.com>
> Jeff> The ref_table will store only one instance of this class.
> Jeff> I think ref_table should hash its objects by address, or something...
>
> I've been thinking about this recently.
> I agree with what you say.
> We need to use object identity, and not equals() or hashCode(), as the
> basis for comparisons here.
>
> One way we could do this is to make a copy of Hashtable which uses,
> say, System.identityHashCode and `=='. This would mean copying a lot
> of code though. I'm reluctant to do this.
JDK 1.4 defines such a hashtable:
http://java.sun.com/j2se/1.4/docs/api/java/util/IdentityHashMap.html
Cedric