Replace full GC macros with CRTP templates

Stefan Karlsson stefan.karlsson at oracle.com
Tue Sep 30 15:55:21 UTC 2014


Hi Eric,

On 2014-09-30 17:39, Erik Österlund wrote:
> Hi,
>
> I didn't like the macros in memory/space.inline.hpp so I replaced them with good old templates instead so I could sleep at night.
> In particular, the Curiously Recurring Template Pattern (CRTP) C++ idiom was used to solve the problem of writing code referencing the code of the derived subclasses without needing virtual calls (static polymorphism).
>
> The macros (e.g. finding out if a block is an object etc) passed in as arguments to the other macros (oh God) have been replaced with intuitive closures.
> All in all macros passed to macros are now closures, the main macros themselves are now inlined template methods achieving the same goals.
>
> If you, like me, want to sleep well at night, do the right thing and vote yes and I will provide a patch. :)

Did you see this thread?

http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2014-August/010606.html

StefanK
>
> /Erik




More information about the hotspot-gc-dev mailing list