[swift-evolution] [swift-evolution-announce] [Review] SE-0125: Remove NonObjectiveCBase and isUniquelyReferenced

Dave Abrahams dabrahams at apple.com
Wed Jul 20 09:24:17 CDT 2016


on Wed Jul 20 2016, Brent Royal-Gordon <swift-evolution at swift.org> wrote:

>> On Jul 20, 2016, at 6:53 AM, Dave Abrahams <dave at boostpro.com> wrote:
>> 
>> There is; it's basically impossible to implement reliably given the
>> state of Objective-C reference-counting.  I'll let Greg Parker explain
>> the details, as he has many times to me (but I don't retain them as well
>> as he does).
>
> I don't necessarily need to know them (although I'd be curious to hear).
>
> I think something that implies the possibility of false negatives,
> like `isKnownUniquelyReferenced(_:)` or (flipping the sense of the
> return value) `mayBeShared(_:)`, is probably the best strategy. Or, if
> COW is the only use case we want to support, 

It's not the only use case for ManagedBuffer[Pointer], if that's what
you mean.

> we could even call it something along the lines of
> `needsCopyBeforeMutating(_:)`, which would strongly imply it was
> unsuitable for any other purpose.

-- 
Dave



More information about the swift-evolution mailing list