On Oct 24, 2013, at 3:39 AM, Maxthon Chan <xcvi...@me.com> wrote:
> On Oct 24, 2013, at 18:23, Greg Parker <gpar...@apple.com> wrote:
>> On Oct 24, 2013, at 3:10 AM, Maxthon Chan <xcvi...@me.com> wrote:
>>> Neither is appropriate in my situation: Only one touch-up is needed so 
>>> converting entire file (even just one method since it is extremely long) to 
>>> MRR is is inappropriate
>> 
>> Write a helper function in a separate non-ARC file.
>> 
>> Do not call objc_retain or objc_release or objc_autorelease directly. 
> 
> And by the way, why not?

It's not published API. That should be a good enough reason.

The author of those functions is telling you not to. That is also typically a 
good reason.

The ARC optimizer will recognize your calls to these functions, assume they 
were generated by the ARC compiler, and possibly mis-optimize your code as a 
result. That is irrelevant given the first two reasons above, but may be 
helpful to know if you were hoping to just use them and get away with it.


> It is well documented in LLVM documentations that those functions are 
> required to be identical to the corresponding methods.

The documentation says that their effect on the retain count is semantically 
equivalent to a message send. That does not mean you can call them yourself. 
That documentation is primarily instructions for implementers.


-- 
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to