RFR: 8333658: NMT: Use an allocator with 4-byte pointers to save memory in NativeCallStackStorage [v5]

Johan Sjölen jsjolen at openjdk.org
Fri Jun 7 10:54:43 UTC 2024


On Thu, 6 Jun 2024 12:44:01 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Fix access specifiers
>>  - Use access specifiers and class for I
>>  - Recognise when we free to the wrong owner
>
> src/hotspot/share/nmt/indexedFreeListAllocator.hpp line 23:
> 
>> 21:       return idx == other.idx;
>> 22:     }
>> 23:   };
> 
> Why so much code? Why not just typedef to uint32?

Now we use access specifiers to deny access to the index, except for the allocator, which is a friend. We do want the index to be opaque, so we do this. On top of that, we use an `_owner` field in debug mode to assert that we don't free to the wrong allocator.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18979#discussion_r1631024187


More information about the hotspot-dev mailing list