Race condition behaviors


extension MemoryLayout {
    static func size<Value>(ofFieldAt path: KeyPath<T, Value>) -> Int? {
        MemoryLayout.offset(of: path).map { _ in MemoryLayout<Value>.size }
    }
}

If we're continuing, let's make a new thread.

2 Likes

I must say this is a genius hack! It answers my question so no need for an extra thread.