Precise GC
deadalnix
deadalnix at gmail.com
Tue Apr 10 01:03:06 PDT 2012
Le 10/04/2012 00:39, Manu a écrit :
> It is, and I still don't follow. I can't imagine there are any indirect
> function calls, except for the ones introduced by this proposal, where
> you may register a function to mark the pointers in complex structs.
> You seem to be suggesting that another one already exists anyway? Where
> is it? Why is it there?
OK, back to basics.
For every type, a function template (let's call it GCscan) will be
instantiated to scan it. This function can be ANY code. ANY code include
the possibility for GCscan!A to call GCscan!B directly, without going
back to GC main loop and indirect call. If inlined, you can forget about
function call at all (and you can force that using mixin template for
example, but it is likely to massively generate code bloat).
This can't be done for reference/pointer to polymorphic types, but for
any other it is an available option, and it can reduce dramatically the
number of indirect calls.
More information about the Digitalmars-d
mailing list