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 {
356356 }
357357
358358#if INTERNAL_CHECKS_ENABLED && COW_CHECKS_ENABLED
359- @inlinable
359+ @_alwaysEmitIntoClient
360360 @_semantics ( " array.make_mutable " )
361361 @_effects ( notEscaping self.** )
362362 internal mutating func _makeMutableAndUniqueUnchecked( ) {
Original file line number Diff line number Diff line change @@ -169,6 +169,16 @@ extension ArraySlice {
169169 }
170170 }
171171
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+
172182 /// Marks the end of a mutation.
173183 ///
174184 /// 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 {
7474 }
7575 }
7676
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+
7787 /// Marks the end of an Array mutation.
7888 ///
7989 /// 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