JOGL, C, arrays and safety

I’m using picking & the selection buffer with JOGL.

Here is the native code for glSelectBuffer

JNIEXPORT void JNICALL
Java_net_java_games_jogl_impl_windows_WindowsGLImpl_glSelectBuffer(JNIEnv *env, jobject _unused, jint size, jintArray buffer) {
GLuint * _ptr1 = NULL;
if (buffer != NULL) {
_ptr1 = (GLuint *) (*env)->GetPrimitiveArrayCritical(env, buffer, NULL);
}
glSelectBuffer((GLsizei) size, (GLuint *) _ptr1);
if (buffer != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, buffer, _ptr1, JNI_ABORT);
}
}

I’m concerned that I fill the buffer and query it after this call. However, there seems to be no guarantee that the JVM hasn’t moved the array somewhere or even that it passed a copy over in the first place.

Am I missing something or is it just unsafe?

Tim

You’re right. I hadn’t used selection or feedback before and hadn’t realized that those routines need to have only New I/O-based accessors (requiring direct buffers, which don’t move in memory). Could you please file a bug on the JOGL Issues page at http://jogl.dev.java.net/ ? Thanks.

OK, I’ve filed a bug report.