> On Jul 12, 2017, at 2:03 PM, Greg Parker <gpar...@apple.com> wrote:
> 
> The benefit of the autoreleasing convention comes when you can return an 
> unretained value without a retain/autorelease pair, because you "know" that 
> the object will live long enough for the callee to use it. This does in fact 
> avoid lots of retain/release pairs in carefully written code.

Yes, this is what I was referring to. I’d forgotten that ARC won’t do this, 
because it has to guarantee safety. In my pre-ARC code I routinely did this, 
and only ran into problems with it a handful of times, so I felt it was a 
valuable optimization (especially in the early 2000s when CPUs were slower.)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to