On 05/16/2013 08:26 PM, Maxthon Chan wrote:
Well Apple documented CFRetain and CFRelease as replacements of
retain/release methods on NSObject which is prohibited with ARC, and
from an incident I discovered that:
1) objc_retain and objc_release does exist on Apple's libobjc2, but
are private API that is not allowed to be used in App Store apps; 2)
CFRetain and CFRelease calls Apple's objc_retain and objc_release
internally. 3) By linking to Foundation on OS X, CoreFoundation is
also included as Foundation is linked to CoreFoundation.
2) Of course. For objects that are not detected to be valid CF objects.
Such detection would then have to be moved into Base, which doesn't
sound sane.
My code have zero intention to use CoreFoundation and it is not
linked against (at least not by a -framework CoreFoundation), hence I
will not use CoreBase in the port. This is why I am asking if those
two functions can be moved.
Linking with Foundation on OS X means linking with CoreFoundation, as
you noted above in 3). Hence I don't see a problem in making this link
explicit with GNUstep. After all, you *are* calling CF functions!
Apple built Foundation on top of CoreFoundation, thanks to Carbon.
GNUstep started fresh and built Base directly on top of libc (and
friends), leaving CoreBase out and awkward.
That's not true. Apple's Foundation is not built on top of CF. They are
intertwined for bridging reasons, but the codebase is separate.
The bridging goes both ways. Meaning:
* CF object:
- C calls are handled by CF
- ObjC calls are handled by CF too
* Foundation object:
- ObjC calls are handhled by Foundation
- C calls are handled by Foundation too
If you are concerned about CoreBase, try implement it in Objective-C
and that will make the moved CFRetain and CFRelease useable. Actually
I think we can safely ditch current CoreBase implementation and start
fresh implementing it using Objective-C on top of Base, wrapping
Objective-C methods into C functions.
CoreBase contains features that cannot be nicely implemented on top of
Base's classes.
The best way forward IMO is for me to complete toll-free bridging and
contribute that to GNUstep. Hopefully in July/August. There isn't that
much work left, but I don't have time now.
--
Luboš Doležel
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev