3 ms·
Two more advantages which are relevant for Swift: 1. Memory high-water-mark is generally lower with RC, which is important for mobile. 2. RC lets you easily d
by ridiculous_fish 10y ago
Two more advantages which are relevant for Swift:
1. Memory high-water-mark is generally lower with RC, which is important for mobile.
2. RC lets you easily determine when there is only one reference to an object. This enables Swift's collections to be value types, one of Swift's key semantics.
- masklinn 10y ago> 2. RC lets you easily determine when there is only one reference to an object. This enables Swift's collections to be value types, one of Swift's key semantics. It also enables some optimisations e.g. Python has immutable strings, but CPython can take advantage of rc=1 to extend strings in-place (avoiding accidentally quadratic concatenation loops until you start storing intermediate references or you try to run the software on alternate implementations)