This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: JNI global refs


> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]