Disable runtime cow verification for mutableSpan property

This commit is contained in:
Meghana Gupta
2025-04-22 12:36:52 -07:00
parent ed3f6b4c35
commit 67b5290ac2
5 changed files with 62 additions and 10 deletions

View File

@@ -818,6 +818,16 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
return false;
}
#if INTERNAL_CHECKS_ENABLED && COW_CHECKS_ENABLED
@_alwaysEmitIntoClient
internal mutating func beginCOWMutationUnchecked() -> Bool {
if Bool(Builtin.beginCOWMutation(&_storage)) {
return true
}
return false;
}
#endif
/// Puts the buffer in an immutable state.
///
/// - Precondition: The buffer must be mutable or the empty array singleton.