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: Alexey Perevalov
Subject: RE: using autorelease in apple's CF
Date: Wed, 13 May 2015 09:25:25 +0300

Hello Ivan and Luboš,

thank you for clarification,
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.

BR,
Alexey


From: address@hidden
Date: Tue, 12 May 2015 21:50:35 +0100
Subject: Re: using autorelease in apple's CF
To: address@hidden
CC: address@hidden

Alexey,

To further clarify:
- Core Foundation: base libraries exposing a C API that implement strings, arrays, etc. Some free software/open source implementations: Apple's implementation, GNUstep's corebase
- Foundation: base libraries exposing an Objective-C API that implement strings, arrays, etc.. Some free software/open source implementations: Apple's implementation, GNUstep's base, Cocotron
- You can add (generally) add Core Foundation objects into Foundation's autorelease pool, and (mostly) send them certain Objective-C messages; that is, they pretend to be/are Objective-C objects
- objc_autorelease, based on its name, would exist in the Objective-C runtime (e.g. libobjc2), and it doesn't. 
- objc_release is provided by the runtime for the sake of ARC, not because it is strictly necessary for an implementation of Foundation written in Objective-C.

HTH

On Tue, May 12, 2015 at 9:34 AM, Luboš Doležel <address@hidden> wrote:
On 05/12/2015 09:34 AM, Alexey Perevalov wrote:
> Hello gnustep developers!
>
> I'm interesting in using autorelease pool from apple's CF
> (http://www.opensource.apple.com/source/CF/,
> http://www.opensource.apple.com/source/CFNetwork/).
> In gnustep implementation autorelease message ([(object) autorelease])
> for allocated object is sending. I'm talking about
> svn.gna.org/svn/gnustep/libs/base/trunk, whole implementation was made
> on objective C. But CF published on opensource.apple.com written on C.
> So the question how they are putting objects into autorelease pool? My
> assumption, somewhere should be objc_autorelease invocation, but where?
>
> BR
> Alexey

You're confusing things. CF doesn't have any functions for
autoreleasing. You can only autorelease via Foundation, which was never
open sourced by Apple.

--
Luboš Doležel

_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev


_______________________________________________ Gnustep-dev mailing list address@hidden https://lists.gnu.org/mailman/listinfo/gnustep-dev

reply via email to

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