2 ms·
> Swift doesn't do this, if I understood what you meant properly. I think Swift can take advantage of the fact that many values are purely stack allocated and
by munificent 5y ago
> Swift doesn't do this, if I understood what you meant properly.
I think Swift can take advantage of the fact that many values are purely stack allocated and don't touch the heap or ref counting system at all. It leans pretty heavily on structs and value types.
Other managed languages are more Java-esque in that basically every value is in principle heap allocated. In those, I think it's more valuable to defer ref counting stack references since there are many more of them and they tend to be frequently mutated.