RFR: JDK-8301983: Refactor MEMFLAGS and AllocFailStrategy [v3]
Justin King
jcking at openjdk.org
Tue Feb 7 15:07:26 UTC 2023
On Tue, 7 Feb 2023 14:42:14 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> I don't like MemoryType. MEMFLAGS makes it indicative that it's a flag for some purpose and sticks out to my eyes as a template parameter, which is part of our coding style. mtWhatever is easy to spot in the code where used. I don't agree with the reasoning for this change. Moving the header file out of allocation.hpp seems good though although we still need to include allocation.hpp to get CHeapObj so not sure how much inclusion that saves.
MEMFLAGS implies it's flags. In C/C++ that almost always means they can be combined together and passed as a single argument. The only other usage I've seen it with is command line options. That is not the case here, it's just an enumeration of types/categories/kinds. It's not a combination of bits or a pattern. The mt prefix is preserved, you can still use mtWhatever, it's just an alias. The prefix mt, AFAIK, quite literally means memory type, hence the chosen name. MEMFLAGS isn't always a template parameter either.
-------------
PR: https://git.openjdk.org/jdk/pull/12454
More information about the serviceability-dev
mailing list