generalized lvalues
Zack Weinberg
zack@codesourcery.com
Fri Nov 19 02:52:00 GMT 2004
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.
> __builtin_objc_gc_strong(ptr) = object;
How about
__builtin_with_write_barrier (ptr = object);
?
Tangentially. I am not enthused by the implication that you (Apple)
have implemented write barriers by compiler annotation of pointer
operations. That's not my idea of state-of-the-art GC technology.
zw
More information about the Gcc
mailing list