8193222: EnsureLocalCapacity() should maintain capacity requests through multiple calls

Reviewed-by: coleenp, dcubed
This commit is contained in:
David Holmes 2017-12-12 19:06:19 -05:00
parent 7ae2347baf
commit b1001c7d7d
4 changed files with 139 additions and 1 deletions

View file

@ -826,7 +826,10 @@ JNI_ENTRY_CHECKED(jint,
}
jint result = UNCHECKED()->EnsureLocalCapacity(env, capacity);
if (result == JNI_OK) {
add_planned_handle_capacity(thr->active_handles(), capacity);
// 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;