JNI: marking and unmarking global and local references
Marcus G. Daniels
mgd@swarm.org
Sun Mar 25 17:42:00 GMT 2001
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)
More information about the Java
mailing list