RFR: 8332042: Move MEMFLAGS to its own include file [v2]

Daniel D. Daugherty dcubed at openjdk.org
Mon May 13 15:30:07 UTC 2024


On Mon, 13 May 2024 14:44:05 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> I rather have this explicit check. If MEMFLAGS>1byte, things break, and I would like to make that explicit.
>> 
>> That said, I can move this static assert to the header. I just wanted to avoid including debug.hpp. My original intent was for this cpp file to be the place in the future for any MEMFLAGS related utility functions, e.g. to-and-from-string conversations.
>
> Could you instead put the static_assert near the code that will break? Right now it looks obscure and weird to have this check when it is obviously correct as long as no one changes the definition. Would it be enough to write a comment in the header that this needs to be 1 byte?

To quote @robehn - Why write a comment for a rule if you can enforce it with code instead...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19172#discussion_r1598665179


More information about the serviceability-dev mailing list