From e582a45a4821496039a7051b24441ba11478dfb3 Mon Sep 17 00:00:00 2001 From: Arnold Schwaighofer Date: Mon, 26 Nov 2018 11:10:21 -0800 Subject: [PATCH 1/2] stdlib: Make ArrayBufferProtocol.init inlinable to facilitate specialization SR-9284 --- stdlib/public/core/ArrayBufferProtocol.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/public/core/ArrayBufferProtocol.swift b/stdlib/public/core/ArrayBufferProtocol.swift index 63f155905a919..38ed74e0abbcc 100644 --- a/stdlib/public/core/ArrayBufferProtocol.swift +++ b/stdlib/public/core/ArrayBufferProtocol.swift @@ -128,7 +128,8 @@ extension _ArrayBufferProtocol where Indices == Range{ // Make sure the compiler does not inline _copyBuffer to reduce code size. @inline(never) - @usableFromInline + @inlineable // This code should be specializable such that copying an array is + // fast and does not end up in an unspecialized entry point. internal init(copying buffer: Self) { let newBuffer = _ContiguousArrayBuffer( _uninitializedCount: buffer.count, minimumCapacity: buffer.count) From baae7ee10b4faf700955cd66621100396c66e564 Mon Sep 17 00:00:00 2001 From: Arnold Schwaighofer Date: Mon, 26 Nov 2018 11:27:58 -0800 Subject: [PATCH 2/2] Fix spelling of inlinable --- stdlib/public/core/ArrayBufferProtocol.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/public/core/ArrayBufferProtocol.swift b/stdlib/public/core/ArrayBufferProtocol.swift index 38ed74e0abbcc..ecebbc8e32603 100644 --- a/stdlib/public/core/ArrayBufferProtocol.swift +++ b/stdlib/public/core/ArrayBufferProtocol.swift @@ -128,8 +128,8 @@ extension _ArrayBufferProtocol where Indices == Range{ // Make sure the compiler does not inline _copyBuffer to reduce code size. @inline(never) - @inlineable // This code should be specializable such that copying an array is - // fast and does not end up in an unspecialized entry point. + @inlinable // This code should be specializable such that copying an array is + // fast and does not end up in an unspecialized entry point. internal init(copying buffer: Self) { let newBuffer = _ContiguousArrayBuffer( _uninitializedCount: buffer.count, minimumCapacity: buffer.count)