Copy-On-Write (COW) Managed Containers?

Per Nordlöw per.nordlow at gmail.com
Tue Oct 20 12:42:26 UTC 2020


What are your thoughts on the pros and cons with copy-on-write 
(COW) managed allocations in D, typically for containers such as 
`std.container.Array`?

Has it been considered for use in a standard 
containers/collections library in D?

Why not?

The only example I've found is C++ is std::string which in some 
versions of STL seems to make use of COW.

Swift, on the other hand, uses it extensively to minimize 
implicit aliasing. At [1] Chris Lattner outlines the design 
choices behind this decision.

[1] https://youtu.be/nWTvXbQHwWs?t=1026


More information about the Digitalmars-d mailing list