[SR-1962] Consider simplifying the isUniquelyReferenced() family and eliminating NonObjectiveCBase #44571
Labels
affects ABI
Flag: Affects ABI
feature
A feature request or implementation
improvement
standard library
Area: Standard library umbrella
swift evolution implemented
Flag → feature: A feature that was approved through the Swift evolution process and implemented
Additional Detail from JIRA
md5: 108ada538de9b191a8ad6a831346edce
Issue Description:
Because of the low-level nature of the
isUniquelyReferenced
operation, one possible design is to eliminateNonObjectiveCBase
, and instead just have theisUniquelyReferencedUnsafe
operation, that would check the contract in debug mode, but would be fast in release mode.For most use cases, developers should be able to use the
ManagedBufferPointer
type, so it is probably acceptable to choose the smaller API surface in the tradeoff between having onlyisUniquelyReferencedUnsafe
for custom classes and complicating the standard library API with a special superclass type.This would leave us with two functions:
isUniquelyReferencedUnsafe()
isUniquelyReferencedNonObjC()
The text was updated successfully, but these errors were encountered: