< prev index next >
test/hotspot/jtreg/gc/stress/TestJNIBlockFullGC/libTestJNIBlockFullGC.c
Print this page
rev 48465 : imported patch 8137099-add-testcase
rev 48468 : imported patch 8137099-phohensee-review
@@ -26,17 +26,17 @@
JNIEXPORT jint JNICALL
Java_TestJNIBlockFullGC_TestCriticalArray0(JNIEnv *env, jclass jCls, jintArray jIn) {
jint *bufIn = NULL;
jint jInLen = (*env)->GetArrayLength(env, jIn);
+ jint result = 0;
+ jint i;
if (jInLen != 0) {
bufIn = (jint*)(*env)->GetPrimitiveArrayCritical(env, jIn, 0);
}
- jint result = 0;
- jint i;
for (i = 0; i < jInLen; ++i) {
result += bufIn[i]; // result = sum of all array elements
}
if (bufIn != NULL) {
< prev index next >