Skip to content

Commit bc27356

Browse files
committed
stdlib: enable runtime checking for COW support by default in assert builds.
This was blocked by an LLDB problem, which is now fixed (swiftlang/llvm-project#1333)
1 parent 79913b9 commit bc27356

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

stdlib/public/core/ContiguousArrayBuffer.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,18 +454,12 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
454454
@_alwaysEmitIntoClient
455455
internal var isImmutable: Bool {
456456
get {
457-
// TODO: Enable COW runtime checks by default (when INTERNAL_CHECKS_ENABLED
458-
// is set). Currently there is a problem with remote AST which needs to be
459-
// fixed.
460-
#if ENABLE_COW_RUNTIME_CHECKS
461457
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
462458
return capacity == 0 || _swift_isImmutableCOWBuffer(_storage)
463459
}
464-
#endif
465460
return true
466461
}
467462
nonmutating set {
468-
#if ENABLE_COW_RUNTIME_CHECKS
469463
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
470464
if newValue {
471465
if capacity > 0 {
@@ -481,17 +475,14 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
481475
"re-setting mutable array buffer to mutable")
482476
}
483477
}
484-
#endif
485478
}
486479
}
487480

488481
@_alwaysEmitIntoClient
489482
internal var isMutable: Bool {
490-
#if ENABLE_COW_RUNTIME_CHECKS
491483
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
492484
return !_swift_isImmutableCOWBuffer(_storage)
493485
}
494-
#endif
495486
return true
496487
}
497488
#endif

0 commit comments

Comments
 (0)