[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CFBridging... Functions in Corebase
From: |
Fred Kiefer |
Subject: |
Re: CFBridging... Functions in Corebase |
Date: |
Tue, 22 Aug 2017 18:56:00 +0200 |
> Am 22.08.2017 um 17:15 schrieb Stefan Bidigaray <address@hidden>:
>
> Hi everyone,
> This message is mostly for Daniel, but anyone with some experience using
> these functions should not hesitate to add their thoughts.
>
> Daniel, I just noticed your pull request on github last night. I'm good with
> most of it, my only concern is the bridging functions. I made a comment last
> night, but later discovered I misunderstood their purpose. I'd like to get
> your pull request merged, and want do discuss it before we move forward.
>
> My understanding of the documentation for CFBridgingRelease and
> CFBridgingRetain is that they are essentially no-ops, unless ARC is in
> effect. And even when ARC is being used they do not do anything other than
> tell the compiler that the object is now controlled by ARC. With that in
> mind, these two "functions" should do nothing other than cast the CF object
> as an ARC aware object, and nothing at all if ARC is not implemented. Does
> this sound reasonable? Another part of this conversation is where do these
> functions belong. According to the Apple documentation, they are part of
> Foundation, so should they not be in Base, instead?
>
> As for CFAutorelease, I think this is the function where
> objc_autoreleaseReturnValue() needs to be used. The documentation for this
> function is nonexistent, so I'm just guessing at what it really does.
>
> Any thoughts? Anyone?
Stefan,
I think you are mostly correct. Apple has this stuff in Foundation, but we
don’t build base on top of CoreFoundation, so we need to have it the other way
around. In ARC-mode these two functions should call the compiler primitives
David pointed to. Where you are incorrect is the non-ARC-mode. There Apple
seems to implement these functions as retain and (auto-)release. Don’t ask me
why, your interpretations makes more sense to me.
Fred
- CFBridging... Functions in Corebase, Stefan Bidigaray, 2017/08/22
- Re: CFBridging... Functions in Corebase,
Fred Kiefer <=
- Re: CFBridging... Functions in Corebase, Stefan Bidigaray, 2017/08/22
- Re: CFBridging... Functions in Corebase, Stefan Bidigaray, 2017/08/22
- Re: CFBridging... Functions in Corebase, Daniel Ferreira (theiostream), 2017/08/23
- Re: CFBridging... Functions in Corebase, Stefan Bidigaray, 2017/08/23
- Re: CFBridging... Functions in Corebase, Daniel Ferreira (theiostream), 2017/08/23
- Re: CFBridging... Functions in Corebase, Stefan Bidigaray, 2017/08/23
github PR branches (was Re: CFBridging... Functions in Corebase), Derek Fawcus, 2017/08/23