Commit 5baebde
committed
JNI: Use GetByteArrayRegion/SetByteArrayRegion
We used GetByteArrayElements/ReleaseByteArrayElements which would "pin" the JVM object and give us a pointer to its memory that we could use in native calls.
This would interact with the GC and cause issues that would be platform-specific and very hard to debug.
We now use GetByteArrayRegion/SetByteArrayRegion which do not "pin" the JVM ovject at all. Instead we copy data to a local buffer and use it, or copy it
back from a local buffer to a JVM array.1 parent 57ca02c commit 5baebde
1 file changed
+276
-403
lines changed
0 commit comments