[Dlang-study] [lifetime] Few root decisions to take on RC classes

deadal nix deadalnix at gmail.com
Sat Oct 31 17:04:50 PDT 2015


> 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.
>
>

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 :
http://clang.llvm.org/docs/Block-ABI-Apple.html
http://clang.llvm.org/docs/AutomaticReferenceCounting.html

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dlang-study/attachments/20151031/f246515c/attachment.html>


More information about the Dlang-study mailing list