Skip to content

Commit 94a7eee

Browse files
committed
[stdlib] Document sources of code bloat
1 parent 1f92df0 commit 94a7eee

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

stdlib/public/core/ClosedRange.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public struct ClosedRange<Bound: Comparable> {
6868
/// The range's upper bound.
6969
public let upperBound: Bound
7070

71+
// This works around _debugPrecondition() impacting the performance of
72+
// optimized code. (rdar://72246338)
7173
@_alwaysEmitIntoClient @inline(__always)
7274
internal init(_uncheckedBounds bounds: (lower: Bound, upper: Bound)) {
7375
self.lowerBound = bounds.lower

stdlib/public/core/Range.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public struct Range<Bound: Comparable> {
157157
/// instance does not contain its upper bound.
158158
public let upperBound: Bound
159159

160+
// This works around _debugPrecondition() impacting the performance of
161+
// optimized code. (rdar://72246338)
160162
@_alwaysEmitIntoClient @inline(__always)
161163
internal init(_uncheckedBounds bounds: (lower: Bound, upper: Bound)) {
162164
self.lowerBound = bounds.lower

stdlib/public/core/UnsafeBufferPointer.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ extension Unsafe${Mutable}BufferPointer: ${Mutable}Collection, RandomAccessColle
394394
}
395395

396396
extension Unsafe${Mutable}BufferPointer {
397+
// This works around _debugPrecondition() impacting the performance of
398+
// optimized code. (rdar://72246338)
397399
@_alwaysEmitIntoClient
398400
internal init(
399401
@_nonEphemeral _uncheckedStart start: Unsafe${Mutable}Pointer<Element>?,

0 commit comments

Comments
 (0)