RFR: 8283368: G1: Remove G1SegmentedArraySegment MEMFLAGS template parameter

Thomas Schatzl tschatzl at openjdk.java.net
Wed Mar 23 10:39:35 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

Lgtm. Would have been nice to have done the refactoring and the segment inlining separately.

-------------

Marked as reviewed by tschatzl (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7891



More information about the hotspot-gc-dev mailing list