RFR: 8227168: Cleanup usage of NEW_C_HEAP_ARRAY

David Holmes david.holmes at oracle.com
Mon Sep 2 21:59:19 UTC 2019

Hi Leo,

On 2/09/2019 10:23 pm, Leo Korinth wrote:
> Hi!
> After I got caught doing an unnecessary check on the return value of 
> NEW_C_HEAP_ARRAY (a mistake that I copied) I thought it would be good to 
> do a cleanup in the sources so that others would not fall into this 
> trap. This is the result.
> I have removed some places where the VM will be shut down after 
> NEW_C_HEAP_ARRAY returns NULL (it never does return NULL, it does 
> instead exit). I have also removed lots of unnecessary casts, that might 
> hide bugs.

Those changes all seem fine, as are the perfMemory changes.

My only issue is with the places where you can changed allocation of a 
NEW_C_HEAP_ARRAY of size 1 to a NEW_C_HEAP_OBJ. They are still freed 
with FREE_C_HEAP_ARRAY which looks odd even though correct (in that it's 
all os::free under the covers anyway). I'm not sure this change is worth 
the potential confusion it may cause.

> There are /numerous/ buggy usage that I have NOT fixed. Those are bugs 
> that ought to be fixed, but they are not in the gc folder, and I am 
> unsure about the best solution (the do not just directly exit the VM). I 
> have created a BUG to track them 
> (https://bugs.openjdk.java.net/browse/JDK-8230395), and I will leave 
> them for others to solve.



> I have changed some code paths that I can not test (AIX for example) so 
> it would be nice if someone could verify it works there.
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8227168
> Webrev:
> http://cr.openjdk.java.net/~lkorinth/8227168/
> Testing:
> mach5 tier1-3 (solaris, linux, windows, mac)
> Thanks,
> Leo

More information about the hotspot-dev mailing list