Skip to content

Commit 2c02ba3

Browse files
authored
Remove a retain-release pair from -count for bridged arrays (#84247)
1 parent 2bdc1f4 commit 2c02ba3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

stdlib/public/core/ContiguousArrayBuffer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ internal final class _ContiguousArrayStorage<
141141

142142
#if _runtime(_ObjC)
143143

144+
@_effects(releasenone)
144145
internal final override func withUnsafeBufferOfObjects<R>(
145146
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
146147
) rethrows -> R {

stdlib/public/core/SwiftNativeNSArray.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ internal class __SwiftNativeNSArrayWithContiguousStorage
5353
deinit {}
5454

5555
// Operate on our contiguous storage
56+
@_effects(releasenone)
5657
internal func withUnsafeBufferOfObjects<R>(
5758
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
5859
) rethrows -> R {
@@ -379,6 +380,7 @@ extension __SwiftNativeNSArrayWithContiguousStorage {
379380
_destroyBridgedStorage(_heapBufferBridged)
380381
}
381382

383+
@_effects(releasenone)
382384
internal override func withUnsafeBufferOfObjects<R>(
383385
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
384386
) rethrows -> R {
@@ -438,7 +440,8 @@ extension __SwiftNativeNSArrayWithContiguousStorage {
438440
internal final class __SwiftDeferredStaticNSArray<Element>
439441
: __SwiftDeferredNSArray {
440442

441-
internal override func withUnsafeBufferOfObjects<R>(
443+
@_effects(releasenone)
444+
final internal override func withUnsafeBufferOfObjects<R>(
442445
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
443446
) rethrows -> R {
444447
while true {
@@ -526,6 +529,7 @@ internal class __ContiguousArrayStorageBase
526529
}
527530

528531
#if _runtime(_ObjC)
532+
@_effects(releasenone)
529533
internal override func withUnsafeBufferOfObjects<R>(
530534
_ body: (UnsafeBufferPointer<AnyObject>) throws -> R
531535
) rethrows -> R {

0 commit comments

Comments
 (0)