On Fri, 9 Aug 2024 15:05:59 GMT, Johan Sjölen <jsjo...@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