In the JNI document, GetStringUTFChars(), which converts a java string jstring
to c++ const char*
, will return an optional jboolean
flag indicating whether it performs copy or not within the function call. However, the document does not mention when GetStringUTFChars() will or will not perform copy. My questions are:
According to the book "Essential JNI Java Native Interface", it is the implementation of the JVM that decides whether a copy is done or not. So no, you have no control over the copying.