On Sun, 21 Jul 2024 10:08:38 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:

>> Sonia, my bad if you already know this stuff but since it's fairly esoteric 
>> knowledge nowadays I'd like to help you out in advance: Thomas is proposing 
>> the usage of a X macro https://en.wikipedia.org/wiki/X_macro
>> 
>> These can be found throughout Hotspot, you can find an example definition 
>> and usage in `logTag.hpp` and `logTag.cpp`.
>
> @SoniaZaldana Note that this is very much optional.

Hi folks, thanks for the pointers! I wasn't familiar with X macros and after 
some time toying around with them, I'm sad to report that I am not a fan (yet!).

I implemented it and ended up breaking part of the tests. I quickly realized 
that debugging these is a bit harder for less experienced c++ developers (like 
myself). 

So, just wanted to note: 
- I cleaned up the indentation in this function as it was all wrong. 
- I didn't get rid of the repetition. Tried to but quickly realized we can't 
pull the DCmdArgument out of the if statements as they're different types. 

And note to self, to keep reviewing X macros because they did shorten the code 
a lot when I implemented them. Perhaps I'll give it another go in a different 
RFE.

Sorry it's not what either of you hoped for!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20198#discussion_r1687080108

Reply via email to