[swift-dev] [idle] COW wrapper in 30 lines
nrotem at apple.com
Wed Mar 9 11:50:36 CST 2016
There is a similar implementation and discussion about performance here:
> On Mar 9, 2016, at 9:39 AM, Jordan Rose via swift-dev <swift-dev at swift.org> wrote:
> Just for fun, I wrote a wrapper for COW types that don't need the flexible inline storage of ManagedBuffer. It turned out to be pretty straightforward, though I didn't bother with materializeForSet and thus am incurring the cost of many extra value copies on mutation. The major downside is having to forward all operations through, something I'm sure the implementers of Array and Dictionary are very used to!
> Disclaimer: This is not performant; don't use it in your app.
> swift-dev mailing list
> swift-dev at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-dev