Discussion about unifying the wording buffer/node/element in G1, especially classes using G1SegmentedArray and related classes

Thomas Schatzl thomas.schatzl at oracle.com
Tue Nov 16 09:38:28 UTC 2021


Hi,

On 12.11.21 09:23, lihuaming (A) wrote:
> Hi all,
> 
> May I have your attention to discuss about unifying the wording buffer/node/element in G1, especially classes using G1SegmentedArray and related classes.
> 
> Background: Currently, the words "buffer", "node" and "element" are used together in G1SegmentedArrayXxx, G1CardSetXxx and related classes in an inconsistent way, which is very unfavorable for understanding. We should not confuse buffer and node together, and not confuse node and element together. The new wording should be based on something like the following rule: A segmented array consists of several buffers one of which consists of several element (or node? we should choose one of element or node).
> 
> I propose to use "segmented array -> buffer -> elem/element", the reasons are: first, "node" is used as memory node, numa node, which is used in lots of other places, e.g. heapRegion, heapRegionSet, G1Allocator,..., while "buffer + node" together is used as buffer in BufferNode/G1BufferNodeList (these classes will not be changes), so "node" should not be used as "element"; In G1CardSet and G1CardSetContainer, most of comments/variables use "elem" rather than "node" for single element.

Thanks for writing this up. As the one primarily responsible for this 
mess, thank you for looking into this.

I'm good with "Segmented Array" -> "Buffer" -> "Element".

Please wait one or two days for additional comments.

Thanks,
   Thomas



More information about the hotspot-gc-dev mailing list