Skip to content

Instantly share code, notes, and snippets.

@arn-e
Created January 22, 2013 01:29
Show Gist options
  • Save arn-e/4591238 to your computer and use it in GitHub Desktop.
Save arn-e/4591238 to your computer and use it in GitHub Desktop.
JNI array conversion
JNIEXPORT jint JNICALL Java_ShortWeight_matrixWeight
(JNIEnv * env, jobject jobj, jintArray matrix_values, jint rows, jint columns)
{
jint *matrix_ptr;
matrix_ptr = (*env)->GetIntArrayElements(env, matrix_values, NULL);
(*env)->ReleaseIntArrayElements(env, matrix_values, matrix_ptr, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment