<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The mechanics of Objective-C ARC are the same as anything else. The only difference is the addition of autorelease: you need to insert an extra opAutorelease call when returning an autoreleased object, and an extra opInc call when receiving one in the caller. For autoreleased object references passed to a function by a pointer or by 'ref', add an opAutorelease before the call, and an opInc after. That's it. Then let the optimizer do elision as usual: opAutorelease counts as an opDec with the only difference being that it cannot be elided.<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div><br><br></div><div>Not even close. ARC is absurdly complex (we even had someone that worked on it show up in the forum and basically tell us it was a bad idea to copy ARC). See for yourself :<br><a href="http://clang.llvm.org/docs/Block-ABI-Apple.html">http://clang.llvm.org/docs/Block-ABI-Apple.html</a><br><a href="http://clang.llvm.org/docs/AutomaticReferenceCounting.html">http://clang.llvm.org/docs/AutomaticReferenceCounting.html</a><br><br></div><div>There are a lot of historical reasons why ARC is that way. One things is sure we don't want to copy this as a model.<br></div><div><br></div><div><br></div></div></div></div>