RFR: 8320370: NMT: Change MallocMemorySnapshot to simplify code. [v2]

Gerard Ziemski gziemski at openjdk.org
Mon Nov 20 17:48:45 UTC 2023


On Mon, 20 Nov 2023 13:35:54 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Hi,
>> 
>> `MallocMemorySnapshot` used to be initialized in a quite non-standard way, using global placement new on an array of `size_t` of the size required to fit `MallocMemorySnapshot`. This looks like it was intended to circumvent some `ResourceObj` internals, but I'm unsure of its purpose. This change does what you expect a regular initialization of a global variable to look like.
>> 
>> ~Currently running through tier1.~ GHA passed and so did tier1 on Oracle CI.
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Thomas comments

Nice clean up!

Just one question: I'm probably missing something here, but did we have to change from `ResourceObj` to `AnyObj` for this change to work?

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

Marked as reviewed by gziemski (Committer).

PR Review: https://git.openjdk.org/jdk/pull/16724#pullrequestreview-1740372675


More information about the hotspot-runtime-dev mailing list