|
|
|
|
|
by smitherfield
3732 days ago
|
|
I might be totally off-base, since unlike you I have no background in compilers, language runtimes etc, but I was under the impression that Swift's ARC is compile-time, which would make it not GC'ed by either of your definitions, whereas runtime ARC, like PHP's implementation, would fit the second. |
|
So, imagine an interface to a reference counted thing. You have two methods:
Add bumps the count, subtract drops the count down. When the count hits zero, the thing is deallocated.What Swift's _automatic_ reference counting is insert the calls to add/subtract _for you_, so that you don't need to do it. But fundamentally, they're still there. So the decision of "when does this get deallocated" is still a runtime thing, even though those calls are compiler inserted.
Does that make sense? Here's another reference: http://stackoverflow.com/questions/6385212/how-does-the-new-...