This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generalized lvalues


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]