RFR (S): 8238999: Remove MemRegion custom new/delete operator overloads

Thomas Schatzl thomas.schatzl at oracle.com
Fri Feb 14 15:05:22 UTC 2020


Hi all,

   can I have reviews for this small change to the MemRegion class to 
remove unnecessary new/delete overloads from MemRegion.

They return NULL if there is not enough memory. This is uncommon to do 
in Hotspot code.

All uses in the code either checks whether the allocation is non-NULL 
and then terminates the VM, or will just crash too.

It is easier to just replace the new[] calls with NEW_C_HEAP_ARRAY 
allocations and do the initialization manually.

cc'ing runtime because Coleen added the new operator for working around 
a Metaspace issue in JDK-8021954 years ago.

CR:
https://bugs.openjdk.java.net/browse/JDK-8238999
Webrev:
http://cr.openjdk.java.net/~tschatzl/8238999/webrev/
Testing:
hs-tier1-4

Thanks,
   Thomas



More information about the hotspot-gc-dev mailing list