On Jun 8, 2016, at 6:13 PM, Dave Abrahams via swift-evolution <[email protected]> wrote: > > on Wed Jun 08 2016, Paul Cantrell <[email protected]> wrote: > >> The interplay of the first two and the last two is what makes the >> language unique. For example, structs have a simple, high-level >> programmer model — “pass by value semantics” — but the compiler jumps >> through all those COW hoops to make them perform _most_ of the time as >> if they were C structs statically allocated and then passed by >> pointer. > > I have no argument with most of what you wrote, but this part is just > inaccurate. Plain structs are never CoW'd, and the compiler doesn't > introduce CoW. The standard library implements CoW “manually” for > specific types like Array and String.
So then only language/runtime magic is isUniquelyReferenced(), and all the other “hoops” are in the standard lib? I guess I just lump compiler and standard library together in my mind too carelessly! P _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
