RFR: 8296231: Fix MEMFLAGS for CHeapBitMaps
Stefan Karlsson
stefank at openjdk.org
Thu Nov 3 11:16:31 UTC 2022
On Wed, 2 Nov 2022 14:56:55 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> > I'd prefer to remove the default value, but there is currently a PR touching the BitMap classes, so I'd like to limit this Bug to only fixing the incorrect usage of mtInternal.
>
> I always wanted something like a thread-bound default Memflags, that could be set with something like MemFlagsMark. It would define the Memflags to be used for the extent if no explicit Memflags are given. This would make sense, especially for utility classes that are used on behalf of other code. For example, wherever we dive into Metaspace allocation, we set the default flag to mtMetaspace, which is probably a good default for all subsequent mallocs in this extent.
>
> What do you think?
I think it is unclear if this would be a net benefit for the code base. IMHO, it's easier to mess up by forgetting to add a MemFlagsMark, than if the compiler straight up told you that you need to provide a MEMFLAGS. It's also harder to look at a CHeap allocating call-site and figure out where the MemFlagsMark is located.
I'm interested in hearing what others think.
-------------
PR: https://git.openjdk.org/jdk/pull/10948
More information about the hotspot-dev
mailing list