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

Johan Sjölen jsjolen at openjdk.org
Mon Apr 29 12:32:39 UTC 2024


On Thu, 25 Apr 2024 10:10:42 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/nmt/memTracker.hpp line 184:
>> 
>>> 182:   }
>>> 183: 
>>> 184:   static inline void allocate_memory_in(MemoryFileTracker::MemoryFile* device, size_t offset, size_t size,
>> 
>> invalid args: `nullptr` and `size == 0`.
>
> We should add tests for `size == 0`, but in general I don't think that's a case that we should disallow. This allows for more generic code where the caller doesn't have to special-case the size being 0. Checking for `nullptr` is a good idea in these outer functions.

I added a test for `size == 0` and I handle it explicitly as a no-op.

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

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


More information about the hotspot-dev mailing list