Re: How do I temporary retain self, under ARC?
Re: How do I temporary retain self, under ARC?
- Subject: Re: How do I temporary retain self, under ARC?
- From: Greg Parker <email@hidden>
- Date: Thu, 17 Jul 2014 20:45:42 -0700
On Jul 17, 2014, at 8:40 PM, Roland King <email@hidden> wrote:
> Using the objc_precise_lifetime attribute ensures the object stays alice to the end of the block.
>
> I think that's a bit better than abusing retain release.
I'm not sure if that is reliable. It's possible that the optimizer sees that the lifetime of the objc_precise_lifetime variable is strictly contained within the lifetime of `self`. The compiler "knows" `self` is alive, so it might decide it can omit any retains and releases from the objc_precise_lifetime variable.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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