RFR: 8312132: Add tracking of multiple address spaces in NMT [v5]

Johan Sjölen jsjolen at openjdk.org
Mon Mar 25 10:13:23 UTC 2024


On Fri, 22 Mar 2024 16:26:00 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/nmt/nmtTreap.hpp line 45:
>> 
>>> 43: // the tree which is O(log n) so we are safe from stack overflow.
>>> 44: 
>>> 45: // TreapNode has LEQ nodes on the left, GT nodes on the right.
>> 
>> Simplification: why do we need a separate template parameter for the comparison? Why not just use K's operators < > == ?
>
> I tend to not use operator-overloading so I didn't think of that as a possibility.

One annoying part about such a design is that you can't use pointers to values as keys, they must now be wrapped within their own type (like `StackIndex` does). Yes, there's a bit of a smell of YAGNI here, but at least `std::set` agrees with me on `Compare` being a template argument.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1537345774


More information about the hotspot-dev mailing list