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]

JNI: marking and unmarking global and local references


JNI says that local and global references are different categories,
but the mark_for_gc and unmark_for_gc conflate them.  For example, the
GCJ libjava runtime will undo the intent of the NewGlobalRef below
(create a unique handle to a preserved global object), since gref and
lref end up having the same value.

  jobject lref = (*env)->GetObjectClass (env, obj);
  jobject gref = (*env)->NewGlobalRef (env, lref);
  (*env)->DeleteLocalRef (env, lref)


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