Looks good to me.
-phil.
On 12/03/2015 01:23 PM, Laurent Bourgès wrote:
https://bugs.openjdk.java.net/browse/JDK-8144445
Please review that webrev that improves overflow checks in ArrayCache:
http://cr.openjdk.java.net/~lbourges/marlin/marlin-8144445.0/
<http://cr.openjdk.java.net/%7Elbourges/marlin/marlin-8144445.0/>
Changes
- check 2Gb overflow in both getNewSize() and getNewLargeSize()
- check negative size / needSize (potential integer math overflow)
- fixed Stroker to use substraction and avoid integer overflow
- added ArrayCacheSizeTest class which now passes in jtreg
Jim's previous comments:
The change looks fine.
Are the long modifiers (12L, 1L, etc) really needed on the shift
parameters given that the first operand (needSize) is already a long?
202 size = ((needSize >> 12L) + 1L) << 12L;
I prefer keeping the long modifiers to be more explicit.
Regards,
Laurent