< prev index next >

src/hotspot/share/prims/jniCheck.cpp

Print this page

        

@@ -824,12 +824,15 @@
     if (capacity < 0) {
       NativeReportJNIFatalError(thr, "negative capacity");
     }
     jint result = UNCHECKED()->EnsureLocalCapacity(env, capacity);
     if (result == JNI_OK) {
+      // increase local ref capacity if needed
+      if ((size_t)capacity > thr->active_handles()->get_planned_capacity()) {
       add_planned_handle_capacity(thr->active_handles(), capacity);
     }
+    }
     functionExit(thr);
     return result;
 JNI_END
 
 JNI_ENTRY_CHECKED(jobject,
< prev index next >