On Fri, Jun 2, 2017 at 12:20 AM, Stefan Bidigaray <stefanb...@gmail.com> wrote: > Are these two functions only supposed to work when ARC is available? Or can > they be used with GCC/GNU-runtime and manual ref. counting? If they have to > work with GCC and manual ref. count, I assume CFBridgingRelease would be a > no-op when the object is a CF-type and a ref. decrement when it is a objc > object. Does that sound about right?
These functions have "ARC" stamped in their description, however they seem to work (i.e. not throw any sort of exception or crash) if they are called outside an ARC context in my Mac, but I'm really not sure what their behavior looks like in this case. Tomorrow I can try to investigate if they affect the object's retain count and see if we get some knowledge out of that. Nevertheless, the calls to objc_retain()/objc_autoreleaseReturnValue() will *only* happen in an ARC context, and since that's only the case when we have the libobjc2 + Clang combination (correct me if I'm wrong), we can wrap calls to these functions around a __has_feature() macro and a GCC build wouldn't be affected by this implementation. Then we can configure a test for this that also does the same __has_feature() check and skips if we're not arc-able. As for tests, I agree they are totally necessary, although I'm not quite sure how to write them. I really appreciate suggestions. _______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev