Avatar
おきんにくでかお 4/17/2025 7:18 AM
関係ないかもですが、だいぶ前に巨大なStateを使った時にクラッシュすることがあって、リンク先のCopyOnWriteBoxで対応できました。 https://forums.swift.org/t/large-structs-and-stack-overflow/44820/7
We have now added a CoW struct that we can use to wrap heavy structs and give them copy on write behaviour. @dynamicMemberLookup struct CoW { init(_ value: T) { _storage = Storage(value) } public subscript(dynamicMember keyPath: WritableKeyPath) -> V { get { value[keyPath: keyPath] } set { value[keyPath: keyP...
👍 1