Re: Retain/Release and Properties clarification
Re: Retain/Release and Properties clarification
- Subject: Re: Retain/Release and Properties clarification
- From: David Duncan <email@hidden>
- Date: Wed, 12 Oct 2011 09:46:54 -0700
On Oct 12, 2011, at 9:21 AM, Bayes Scott F wrote:
> Someone on Matt's site mentioned the possibility that the synthesized ivar could be implemented indirectly, say as a member of a collection. Since the implementation's opaque, we don't know if that ever can happen.
I can't say that I know what could be done, thats something the compiler guys would have to figure out :).
> And does the compiler ever shortcut something like self.mySynthSimpleIntVar to self->mySynthSimpleIntVar, or does it always use the setter/getter?
Due to the nature of C and Obj-C, the compiler can never safely short circuit the message send. From C's point of view this is due to the compiler seeing an opaque implementation of objc_msgSend*() where you see the accessor, as such the C compiler cannot inline the function. From an Obj-C point of view, the primary issue is that the compiler doesn't actually know for certain that other code in your application or the frameworks it links against haven't changed the implementation of your accessor and thus require it to be called for correct operation.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden