mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Adopt safe addressors in Swift's Array family of types.
rdar://190323998 Swift SVN r24599
This commit is contained in:
@@ -270,6 +270,10 @@ public struct _ContiguousArrayBuffer<T> : _ArrayBufferType {
|
||||
return isUniquelyReferenced()
|
||||
}
|
||||
|
||||
public mutating func isMutableAndUniquelyReferencedOrPinned() -> Bool {
|
||||
return isUniquelyReferencedOrPinned()
|
||||
}
|
||||
|
||||
/// If this buffer is backed by a `_ContiguousArrayBuffer`
|
||||
/// containing the same number of elements as `self`, return it.
|
||||
/// Otherwise, return `nil`.
|
||||
@@ -381,6 +385,13 @@ public struct _ContiguousArrayBuffer<T> : _ArrayBufferType {
|
||||
return __bufferPointer.holdsUniqueReference()
|
||||
}
|
||||
|
||||
/// Return true iff this buffer's storage is either
|
||||
/// uniquely-referenced or pinned. NOTE: this does not mean
|
||||
/// the buffer is mutable; see the comment on isUniquelyReferenced.
|
||||
public mutating func isUniquelyReferencedOrPinned() -> Bool {
|
||||
return __bufferPointer.holdsUniqueOrPinnedReference()
|
||||
}
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
/// Convert to an NSArray.
|
||||
/// Precondition: T is bridged to Objective-C
|
||||
|
||||
Reference in New Issue
Block a user