RFR: 8337217: Port VirtualMemoryTracker to use VMATree
Afshin Zafari
azafari at openjdk.org
Fri Nov 8 10:52:06 UTC 2024
On Fri, 9 Aug 2024 15:05:59 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> src/hotspot/share/nmt/regionsTree.hpp line 46:
>>
>>> 44: using Node = VMATree::TreapNode;
>>> 45:
>>> 46: class NodeHelper : public Node {
>>
>> This shouldn't inherit from `Node` and then have each instance be cast into `NodeHelper`. Make into `class Utils : public AllStatic`.
>
> Alternatively create it by composition:
>
> ```c++
> class NodeHelper {
> Node& node;
> NodeHelper(Node* node) : node(*node) {}
> // All of the methods
> };
>
> { // Some Node* node
> NodeHelper nh(node);
> // Use nh
> }
Done. The alternative way.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1713462208
More information about the core-libs-dev
mailing list