gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using autorelease in apple's CF


From: David Chisnall
Subject: Re: using autorelease in apple's CF
Date: Wed, 13 May 2015 08:52:35 +0100

On 13 May 2015, at 07:25, Alexey Perevalov <address@hidden> wrote:
> 
> right now it's more clear, I think, due CF function is not automatically put 
> bridged(or not) objects  into autorelease pool, e.g. 
> CFStreamCreatePairWithSocket,
> client should release it manually, like in 
> https://github.com/robbiehanson/CocoaAsyncSocket/blob/master/GCD/GCDAsyncSocket.m
>  with readStream/writeStream.

There are some grey areas.  Apple has now marked up most (all?) of their CF 
APIs with ARC-compatible annotations indicating ownership transfer, so if you 
use CF APIs from an Objective-C compilation unit compiled with ARC then you 
don’t need to worry about memory management - ARC will handle it for you.  I 
don’t believe that these annotations have made it into GNUstep’s CoreBase (CF 
implementation).

David

-- Sent from my brain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]