RFR: 8283368: G1: Remove G1SegmentedArraySegment MEMFLAGS template parameter
Albert Mingkun Yang
ayang at openjdk.java.net
Thu Mar 24 10:09:46 UTC 2022
On Mon, 21 Mar 2022 14:02:32 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
> Hi all,
>
> Please review this change to remove the MEMFLAGS template parameter for G1SegmentedArraySegment and make it a runtime configuration parameter. This reduces on the code bloat due to templating because many of the methods in G1SegmentedArraySegment are independent of the template parameter.
>
> To achieve this we added factory methods for handling allocation and deallocation. Having the factory methods allows us to embed the array data with the G1SegmentedArraySegment struct thus limiting the allocation to a single allocation as well as the deallocation. One upside to this approach is that we limit the allocation and deallocation overheads.
>
> Thanks
> Ivan
Marked as reviewed by ayang (Reviewer).
src/hotspot/share/gc/g1/g1SegmentedArray.cpp line 107:
> 105:
> 106: next = G1SegmentedArraySegment::create_segment(slot_size(), num_slots, prev, _alloc_options->mem_flag());
> 107: // next = new G1SegmentedArraySegment(slot_size(), num_slots, prev);
Seems unneeded.
src/hotspot/share/gc/g1/g1SegmentedArray.hpp line 116:
> 114: return segment.next_addr();
> 115: }
> 116: typedef LockFreeStack<G1SegmentedArraySegment, &G1SegmentedArrayFreeList::next_ptr> SegmentStack;
`using` to be consistent?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7891
More information about the hotspot-gc-dev
mailing list