Skip to content

Commit e4c65d1

Browse files
committed
[stdlib] Restore some @inlinable for performance.
Dropping many of Array's @inlinable annotations caused some performance regressions. Restore them temporarily while we figure out how to better annotate these decls.
1 parent e907d11 commit e4c65d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/core/Arrays.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol {
13381338
/// The count of the new buffer is set to `oldCount`, the capacity of the
13391339
/// new buffer is big enough to hold 'oldCount' + 1 elements.
13401340
@inline(never)
1341-
@usableFromInline
1341+
@inlinable // @specializable
13421342
internal mutating func _copyToNewBuffer(oldCount: Int) {
13431343
let newCount = oldCount + 1
13441344
var newBuffer = _buffer._forceCreateUniqueMutableBuffer(
@@ -1990,7 +1990,7 @@ extension _ArrayBufferProtocol {
19901990
/// max(requiredCapacity, source.capacity) if newCount <= source.capacity
19911991
/// max(requiredCapacity, _growArrayCapacity(source.capacity)) otherwise
19921992
@inline(never)
1993-
@usableFromInline
1993+
@inlinable // @specializable
19941994
internal func _forceCreateUniqueMutableBuffer(
19951995
newCount: Int, requiredCapacity: Int
19961996
) -> _ContiguousArrayBuffer<Element> {
@@ -2006,7 +2006,7 @@ extension _ArrayBufferProtocol {
20062006
/// max(minNewCapacity, source.capacity) if minNewCapacity <= source.capacity
20072007
/// max(minNewCapacity, _growArrayCapacity(source.capacity)) otherwise
20082008
@inline(never)
2009-
@usableFromInline
2009+
@inlinable // @specializable
20102010
internal func _forceCreateUniqueMutableBuffer(
20112011
countForNewBuffer: Int, minNewCapacity: Int
20122012
) -> _ContiguousArrayBuffer<Element> {
@@ -2055,7 +2055,7 @@ extension _ArrayBufferProtocol {
20552055
/// As an optimization, may move elements out of source rather than
20562056
/// copying when it isUniquelyReferenced.
20572057
@inline(never)
2058-
@usableFromInline
2058+
@inlinable // @specializable
20592059
internal mutating func _arrayOutOfPlaceUpdate<Initializer>(
20602060
_ dest: inout _ContiguousArrayBuffer<Element>,
20612061
_ headCount: Int, // Count of initial source elements to copy/move

0 commit comments

Comments
 (0)