Ziemowit Laski <zlaski@apple.com> writes:
The __builtin_gc_register approach would require that the entire GC
API be redesigned, and of course would be extremely inefficient, since
_every_ assignment in a program would have to go through a
write-barrier which would either do something or nothing depending on
whether __builtin_gc_register and/or __builtin_gc_unregister has been
called.
I think you misunderstood what I meant it to mean - it was intended to
be a suggestion for alternative notation producing *exactly the same
code generation* as your proposal. In other words, the effect of
__builtin_gc_register would be to notify the compiler to generate
write barriers for every assignment to ptr from then until a
subsequent __builtin_gc_unregister.