RFR: 8320370: NMT: Change MallocMemorySnapshot to simplify code. [v2]
Johan Sjölen
jsjolen at openjdk.org
Tue Nov 21 13:35:07 UTC 2023
On Tue, 21 Nov 2023 10:02:40 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> > > 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?
> >
> >
> > Hi Gerard, no I think it is unnecessary to do this change to make it work (I haven't checked). I do think keeping it as `AnyObj` is a good idea however, as `MallocMemorySnapshot` is never resource allocated.
>
> Why not make it a simple object then? Why derive from anything at all?
>
> (Update: I am fine with the current state of the patch; up to you)
It's not clear to me what the rules are on this matter. To what degree are plain global classes allowed in HotSpot? I thought that they all need to inherit from `AnyObj`,`CHeapObj`, etc. Seems like we're more OK with internal (structs and classes within other classes) being "undecorated" with their allocation capabilities.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16724#issuecomment-1820934602
More information about the hotspot-runtime-dev
mailing list