Skip to content

Commit 3e95ba3

Browse files
authored
Merge pull request #20 from lorentey/watchOS-warning-fix
DoubleWord._readersBitWidth: Switch to using Int.bitWidth
2 parents df9f811 + 09ddcdd commit 3e95ba3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: Sources/Atomics/AtomicStrongReference.swift

+3-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,9 @@ extension DoubleWord {
7979

8080
@inline(__always)
8181
fileprivate static var _readersBitWidth: Int {
82-
#if arch(i386) || arch(arm) || arch(arm64_32)
83-
return 8
84-
#else
85-
return 16
86-
#endif
82+
// This reserves 8 bits for the accesses-in-flight counter on 32-bit
83+
// systems, and 16 bits on 64-bit systems.
84+
Int.bitWidth / 4
8785
}
8886

8987
@inline(__always)

0 commit comments

Comments
 (0)