Replace full GC macros with CRTP templates
Erik Österlund
erik.osterlund at lnu.se
Tue Sep 30 16:17:38 UTC 2014
I appear to have missed this. Looks like we have solved the same problem but in slightly different ways.
Mine uses more modular closures and a down-casted derived space object instead of a space proxy object.
I'm fine with whichever variant as long as the macros become inline methods. :)
/Erik
On 30 Sep 2014, at 17:55, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
> 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