Commit 7d2633f authored and committed Oct 12, 2021
1 parent cfe7471 commit 7d2633f Copy full SHA for 7d2633f
File tree 1 file changed +2
-10
lines changed
src/java.base/share/classes/java/lang
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -231,21 +231,13 @@ private void ensureCapacityInternal(int minimumCapacity) {
231
231
}
232
232
}
233
233
234
- /**
235
- * The maximum size of array to allocate (unless necessary).
236
- * Some VMs reserve some header words in an array.
237
- * Attempts to allocate larger arrays may result in
238
- * OutOfMemoryError: Requested array size exceeds VM limit
239
- */
240
- private static final int MAX_ARRAY_SIZE = Integer .MAX_VALUE - 8 ;
241
-
242
234
/**
243
235
* Returns a capacity at least as large as the given minimum capacity.
244
236
* Returns the current capacity increased by the current length + 2 if
245
237
* that suffices.
246
238
* Will not return a capacity greater than
247
- * {@code (MAX_ARRAY_SIZE >> coder)} unless the given minimum capacity
248
- * is greater than that.
239
+ * {@code (SOFT_MAX_ARRAY_LENGTH >> coder)}
240
+ * unless the given minimum capacity is greater than that.
249
241
*
250
242
* @param minCapacity the desired minimum capacity
251
243
* @throws OutOfMemoryError if minCapacity is less than zero or
You can’t perform that action at this time.
0 commit comments