Storing C++ data in an instance field using CNI?

David Daney ddaney@avtrex.com
Thu May 27 18:21:00 GMT 2004


Stanley Brown wrote:
> I played a little bit with RawData. Soon my Java code became very GCJ 
> dependent. I eventually switched back to JNI (which GCJ handles just 
> fine) storing pointers in long instance variables and NIO buffers. To 
> be fair this was mainly because I ran into complications on the Win32 
> port where (1) I could not mix C++ and GCJ and (2) creating instances 
> of Calendar overloaded the memory.
>> Could someone please explain the advantage of using RawData over the 
> methods I employed?
>CNI has lower overhead than JNI.
If you use RawData, your code will continue to work when ported to 
architectures with 128bit pointers.
David Daney.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /