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

Johan Sjölen jsjolen at openjdk.org
Mon Apr 29 08:56:18 UTC 2024


On Fri, 26 Apr 2024 11:41:57 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> I've been using `size_t` so far to indicate that we are within some file with some offset. I'm not sure that `address` is ever the right choice for `VMATree` as it is a `uchar*`, indicating that it's a directly dereferencable pointer. It's not a huge deal whether we choose `size_t`, `uintptr_t` or `address` for our internal representation IMHO, as long as the external interface (`MemTracker`) correctly indicates what kind of address is expected.
>> 
>> @tstuefe, @gerard-ziemski. This discussion is easily lost in the sea of comments, so pinging you directly here.
>
> How about making your own index type? Something that clearly distinguishes it from sizes. Can be a simple typedef.
> 
> I think address would be wrong. But size_t is also feeling off. I know we use size_t in other places as index or offset, but it still throws me off, I think of size_t as a size, not an offset.

I'm fine with `typedef`:ing `size_t`, but I'd like a naming suggestion from you if that's alright. Naming isn't my strong suit and I'd prefer only doing the rename once :).

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

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


More information about the hotspot-dev mailing list