Re: [swift-dev] COW for non-mutating methods

2016-12-01 Thread Joe Groff via swift-dev
> On Dec 1, 2016, at 3:29 AM, Patrick Pijnappel via swift-dev > wrote: > > I'm implementing a COW big int type but am running into problems with > non-mutating functions (e.g. the + operator). Simplified example code below > shows AFAIK the default way to implement COW, but the non-mutating m

[swift-dev] COW for non-mutating methods

2016-12-01 Thread Patrick Pijnappel via swift-dev
I'm implementing a COW big int type but am running into problems with non-mutating functions (e.g. the + operator). Simplified example code below shows AFAIK the default way to implement COW, but the non-mutating method doesn't identify the reference as unique (even with -O), resulting in a needles