4 ms·
Speaking out of genuine ignorance here...if the only ways to get memory safety without GC, how does Swift or Objective C do it with ARC?
by tombert 8y ago
Speaking out of genuine ignorance here...if the only ways to get memory safety without GC, how does Swift or Objective C do it with ARC?
- deleted 8y ago[deleted]
- littlestymaar 8y agoArc is a kind of automatic memory management that's included when people talk about GC in general.
- pcwalton 8y agoReference counting is a form of garbage collection.
- tombert 8y agoYes but this is done at compile-time, not runtime, isn't it? EDIT: Upon reading some stuff, apparently I am mistaken, and it's got runtime overhead. Silly me.
- steveklabnik 8y agoYou're not totally wrong; that's the "A" in ARC: Automatic. It automatically inserts code at compile time, but that code has a runtime effect.