mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +02:00
8240590: Add MemRegion::destroy_array to complement introduced create_array
Reviewed-by: lkorinth, sjohanss
This commit is contained in:
parent
e7204cbc52
commit
cc83c45595
5 changed files with 21 additions and 9 deletions
|
@ -1782,10 +1782,11 @@ bool FileMapInfo::map_heap_data(MemRegion **heap_mem, int first,
|
|||
|
||||
struct Cleanup {
|
||||
MemRegion* _regions;
|
||||
uint _length;
|
||||
bool _aborted;
|
||||
Cleanup(MemRegion* regions) : _regions(regions), _aborted(true) { }
|
||||
~Cleanup() { if (_aborted) { FREE_C_HEAP_ARRAY(MemRegion, _regions); } }
|
||||
} cleanup(regions);
|
||||
Cleanup(MemRegion* regions, uint length) : _regions(regions), _length(length), _aborted(true) { }
|
||||
~Cleanup() { if (_aborted) { MemRegion::destroy_array(_regions, _length); } }
|
||||
} cleanup(regions, max);
|
||||
|
||||
FileMapRegion* si;
|
||||
int region_num = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue