http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47012

Nicola Pero <nicola at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.19 18:31:43
                 CC|                            |nicola at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Nicola Pero <nicola at gcc dot gnu.org> 2010-12-19 18:31:43 
UTC ---
Hi Jonathan

nice to hear from you again (we met at Fosdem a few years ago, not sure you
remember me; I do remember you). ;-)

You are right that the GNU runtime does [[x retain] autorelease] before 
returning the value for an object, nonatomic synthesized property .  The reason 
everyone but Apple does it, I suppose, it is because everyone felt it is a bug 
in the Apple implementation. ;-)

The additional retain/autorelease should make it safer (but slower) than the
Apple implementation; I don't think it should cause it to behave differently
(other than prevent the object from being released until the next autorelease
pool is emptied).  Do you have a testcase where an actual difference in 
behaviour (other than the object being safe to use for longer, and the 
implementation with autorelease/retain being obviously slower) can be seen ?

I guess you're concerned about performance ?

Do you have any evidence that Apple did that on purpose and it's not a bug ?  
If you have any such evidence [ie, they won't "fix" it at the next release and 
we'll suddenly be the "broken" ones ;-)], we should certainly change it to 
behave in the same way.

Maybe we should change it to behave in the same way anyway ;-)

Thanks

PS: Your contribution to GCC's libobjc would be much appreciated.  The existing 
implementation of properties accessors is fairly finished though --

http://gcc.gnu.org/viewcvs/trunk/libobjc/accessors.m?revision=165903&view=markup

It would be a one-liner to make the change if we want to.

Reply via email to