Home arrow static arrow Java Programming [Archive] - Java/C++ point to same datastructure
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Java/C++ point to same datastructure
This topic has 1 reply on 1 page.

Posts:177
Registered: 1/14/02
Java/C++ point to same datastructure  
Aug 8, 2004 9:58 AM



 
I have Java code which has an very large 2 dimennsional array. There some C++ code which needs to do some number crunching on it. It would be much faster pass a pointer to the array from Java to C++ rather than the entire array. Is this possible? (via the JNI)
 

Posts:1,495
Registered: 6/16/03
Re: Java/C++ point to same datastructure  
Aug 8, 2004 10:50 AM (reply 1 of 1)



 
The java.nio offers "direct buffers" which can be used in this way. However, you can't make it work with your existing 2-d array without copying.... Look at the docs for the java.nio.
 
This topic has 1 reply on 1 page.