I Agree with Andrew, regarding the reference JNI library code; this code is *NOT* the VM*.java interface, so it should be written to be compatible with any JNI compliant JVM. As far as I know, disguising a native pointer into a Java reference is not portable across JVMs.
IMO, the cleanest approach is really the use of a byte array. It allows for *any* native pointer length, without making this length explicit in any Java source code (assuming these arrays are allocated in the native JNI parts). The Garbage collector can move this array as it wishes, yet the value will be preserved.
I oppose the use of long-term maintenance trouble things such as "int" or "long". As for performance, the additional indirection cost, to get the byte array content value (e.g. the native pointer) is offset by the cost of the JNI call itself.
Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/
_______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

