Skip to content

Commit e57ba99

Browse files
Merge pull request #20763 from aschwaighofer/inlinable_arraybufferprotocol_init
stdlib: Make ArrayBufferProtocol.init inlinable to facilitate specialization
2 parents 0593c74 + baae7ee commit e57ba99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/core/ArrayBufferProtocol.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ extension _ArrayBufferProtocol where Indices == Range<Int>{
128128

129129
// Make sure the compiler does not inline _copyBuffer to reduce code size.
130130
@inline(never)
131-
@usableFromInline
131+
@inlinable // This code should be specializable such that copying an array is
132+
// fast and does not end up in an unspecialized entry point.
132133
internal init(copying buffer: Self) {
133134
let newBuffer = _ContiguousArrayBuffer<Element>(
134135
_uninitializedCount: buffer.count, minimumCapacity: buffer.count)

0 commit comments

Comments
 (0)