[swift-dev] How does a standard collection know when its storage has to die?

Daryle Walker darylew at mac.com
Wed Oct 25 17:28:49 CDT 2017


OK, so the standard collections (Array, Set, Dictionary) are value types with remote storage. Since they don’t have de-initializers, how would any reference count get any notification to eventually de-allocate ? Or is the memory leaked? Or is some sort of secret system-provided de-initalizer added?

Just thinking of a undiscriminated union idea and wondering how to prevent this kind of leak. 

Sent from my iPhone


More information about the swift-dev mailing list