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 patches


mgd@swarm.org (Marcus G. Daniels) writes:

> 2. split local ref table from global ref table.  The handles should be 
>    unique as I understand JNI.  The way it is now means that someone 
>    can call DeleteGlobalRef on a local ref or vice-versa.  

I am not convinced this is needed.  Does anything in the JNI prohibit the
following implementation:

* Locals refs and global refs are the same.  When either refers to an
object, the ref is just a pointer to the Java object.

* NewGlobalRef is an identify operation.

* DeleteLocalRef and DeleteGlobalRef do nothing.

I'm not seeing how a valid JNI program can not work given this
implementation.  I'm assuming the conservative GC will find
both local and global references assuming it normally scans
C static and local variables.  Is that not the case?
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


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