3 ms·
Swift is technically not a language with GC I believe. It's probably using reference counting like Objective-C before.
by wsc981 5y ago
Swift is technically not a language with GC I believe. It's probably using reference counting like Objective-C before.
- pjmlp 5y agoReference counting is a GC algorithm, despite urban knowledge that describes it as otherwise. Chapter 5 on the "The Garbage Collection Handbook", https://gchandbook.org/contents.html https://gchandbook.org/contents.html Or if you prefer chapter 2 on "Uniprocessor Garbage Collection Techniques" https://www.cs.cmu.edu/~fp/courses/15411-f08/misc/wilson94-gc.pdf https://www.cs.cmu.edu/~fp/courses/15411-f08/misc/wilson94-g... Plenty of SIGPLAN papers about the subject. Despite all marketing talk, the real reason why Swift went with ARC was easier interoperability with Objective-C, otherwise Apple would need to build something like .NET's RCW/CCW for COM interop on Windows, which follows the same concept as Cocoa's retain/release calls.