On Jan 30, 2015, at 12:49 AM, Quincey Morris 
<quinceymor...@rivergatesoftware.com> wrote:

> On Jan 29, 2015, at 22:21 , Ken Thomases <k...@codeweavers.com> wrote:
>> 
>> Huh?  It has to be an autorelease and not a release because the object needs 
>> to survive to the caller's scope.
> 
> "Release" meant “eventual relinquishment of ownership”.

Sorry if I was overly literal.

> Since we’re talking about ARC, I wasn’t assuming that it would be an actual 
> auto-release. In the current implementation, it might be returned retained 
> for eventual release in the caller’s scope, I think.

Code compiled with ARC has to be compatible with code that's compiled without 
ARC and vice versa.  A getter compiled with ARC can't assume the caller was 
also compiled with ARC and so it can't return it retained unconditionally.  
There's the funky optimization between objc_autoreleaseReturnValue() and 
objc_retainAutoreleasedReturnValue() which has that effect conditionally if 
both were compiled with ARC as detected at run time, but the general form of 
the generated getter code is to autorelease the value.

> Anyway, thanks for clarifying the main point.

You're welcome.

Cheers,
Ken

_______________________________________________

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