This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Storing C++ data in an instance field using CNI?
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.