COW (копирование при записи) в Swift. Почему корова работает только с типом коллекции? ⇐ IOS
-
Anonymous
COW (копирование при записи) в Swift. Почему корова работает только с типом коллекции?
The cow(copy on write) doesn't work for custom structures and basic data types(except strings), but I'm wondering why. Can I know the relevant reference?
I learned that when copying a value called cow, it is a memory-saving technique by sharing the original until one of the values modifies it. However, as far as I know, the type that cow works is limited to the collection type only. Is this because cow works optimally when dealing with large amounts of data? Also, why doesn't cow work when copying custom structures or basic data types?
Источник: https://stackoverflow.com/questions/781 ... ction-type
The cow(copy on write) doesn't work for custom structures and basic data types(except strings), but I'm wondering why. Can I know the relevant reference?
I learned that when copying a value called cow, it is a memory-saving technique by sharing the original until one of the values modifies it. However, as far as I know, the type that cow works is limited to the collection type only. Is this because cow works optimally when dealing with large amounts of data? Also, why doesn't cow work when copying custom structures or basic data types?
Источник: https://stackoverflow.com/questions/781 ... ction-type
Мобильная версия