-
Enhancement
-
Resolution: Fixed
-
P4
-
15
-
b16
From [~stefank]:
Catching up on mail and found that this was pushed to G1:
G1CMRootMemRegions::G1CMRootMemRegions(uint const max_regions) :
- _root_regions(NULL),
+ _root_regions(MemRegion::create_array(max_regions, mtGC)),
...
G1CMRootMemRegions::~G1CMRootMemRegions() {
- delete[] _root_regions;
+ FREE_C_HEAP_ARRAY(MemRegion, _root_regions);
}
I'd like to suggest that we all use "matching" code for creation and deletion.
Previous version of the patch used NEW_C_HEAP_ARRAY, so it was easy to see that the code matched. If we add a create_array, I'd like to suggest adding a destroy_array function as well.
That method should also call the destructors then.
Catching up on mail and found that this was pushed to G1:
G1CMRootMemRegions::G1CMRootMemRegions(uint const max_regions) :
- _root_regions(NULL),
+ _root_regions(MemRegion::create_array(max_regions, mtGC)),
...
G1CMRootMemRegions::~G1CMRootMemRegions() {
- delete[] _root_regions;
+ FREE_C_HEAP_ARRAY(MemRegion, _root_regions);
}
I'd like to suggest that we all use "matching" code for creation and deletion.
Previous version of the patch used NEW_C_HEAP_ARRAY, so it was easy to see that the code matched. If we add a create_array, I'd like to suggest adding a destroy_array function as well.
That method should also call the destructors then.
- relates to
-
JDK-8238999 Remove MemRegion custom new/delete operator overloads
- Resolved