Skip to content

Commit 0b5233f

Browse files
committed
stdlib: Mark UnsafeRawBufferPointer's withContiguousStorageIfAvailable as @inline(__always)
The body seems to only reinterpret pointer types (`withMemoryRebound`). Inlining it should not lead to code size gains and has shown to reduce code size.
1 parent 450cb14 commit 0b5233f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,7 @@ extension Unsafe${Mutable}RawBufferPointer {
11631163

11641164
% if Mutable:
11651165
@_alwaysEmitIntoClient
1166+
@inline(__always)
11661167
public func withContiguousMutableStorageIfAvailable<R>(
11671168
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R
11681169
) rethrows -> R? {
@@ -1180,6 +1181,7 @@ extension Unsafe${Mutable}RawBufferPointer {
11801181

11811182
% end
11821183
@_alwaysEmitIntoClient
1184+
@inline(__always)
11831185
public func withContiguousStorageIfAvailable<R>(
11841186
_ body: (UnsafeBufferPointer<Element>) throws -> R
11851187
) rethrows -> R? {

0 commit comments

Comments
 (0)