File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ extension Array {
356
356
}
357
357
358
358
#if INTERNAL_CHECKS_ENABLED && COW_CHECKS_ENABLED
359
- @inlinable
359
+ @_alwaysEmitIntoClient
360
360
@_semantics ( " array.make_mutable " )
361
361
@_effects ( notEscaping self.** )
362
362
internal mutating func _makeMutableAndUniqueUnchecked( ) {
Original file line number Diff line number Diff line change @@ -169,6 +169,16 @@ extension ArraySlice {
169
169
}
170
170
}
171
171
172
+ #if INTERNAL_CHECKS_ENABLED && COW_CHECKS_ENABLED
173
+ @_alwaysEmitIntoClient
174
+ @_semantics ( " array.make_mutable " )
175
+ internal mutating func _makeMutableAndUniqueUnchecked( ) {
176
+ if _slowPath ( !_buffer. beginCOWMutationUnchecked ( ) ) {
177
+ _buffer = _Buffer ( copying: _buffer)
178
+ }
179
+ }
180
+ #endif
181
+
172
182
/// Marks the end of a mutation.
173
183
///
174
184
/// After a call to `_endMutation` the buffer must not be mutated until a call
Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ extension ContiguousArray {
74
74
}
75
75
}
76
76
77
+ #if INTERNAL_CHECKS_ENABLED && COW_CHECKS_ENABLED
78
+ @_alwaysEmitIntoClient
79
+ @_semantics ( " array.make_mutable " )
80
+ internal mutating func _makeMutableAndUniqueUnchecked( ) {
81
+ if _slowPath ( !_buffer. beginCOWMutationUnchecked ( ) ) {
82
+ _buffer = _buffer. _consumeAndCreateNew ( )
83
+ }
84
+ }
85
+ #endif
86
+
77
87
/// Marks the end of an Array mutation.
78
88
///
79
89
/// After a call to `_endMutation` the buffer must not be mutated until a call
You can’t perform that action at this time.
0 commit comments