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




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


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