4 ms·
What means "swift is memory safe"? does it use a GC?
by merb 11y ago
What means "swift is memory safe"? does it use a GC?
- mcphage 11y agoNo, it uses "automatic reference counting"—it keeps a reference count of memory usage and frees it when it's no longer being referenced. And (for the most part) it automatically inserts the reference counting into your code during compilation. There are still some hints that you need to give it (like telling it about weak references to avoid reference loops, etc.)