@robtimp @jesse_squires Unowned is faster and allows for immutability and nonoptionality. If you don't need weak, don't use it.
-
-
@jckarter thanks, that clarifies it =) -
@chriseidhof It's a space/time tradeoff. unowned can't free memory until unowned refs die, but weak frees immediately when strong refs die. - View other replies
-
@jckarter ah, so the second refcount tracks how many things refer to that unowned object? -
@chriseidhof Yeah, so we can check whether the object is still alive before strong-retaining it again. - View other replies
-
@jckarter wait, so as long as there's an unowned ref, memory isn't freed? How does unowned prevent ref cycles then? -
@jckarter when A refers B strongly, and B refers A unowned, it still creates a cycle? Because A only is released after unowned releases? - View other replies
-
@chriseidhof The object is destroyed and gives up all its resources when the last strong reference is released. - View other replies
-
@chriseidhof The memory for the instance is still allocated but left in a zombie state. - View other replies
- Show more
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Joe Groff
Chris Eidhof