Skip to content

Commit 09ddcdd

Browse files
committed
DoubleWord._readersBitWidth: Switch to using Int.bitWidth
This fixes a spurious warning about `arch(arm64_32)` emitted by swift.org compiler builds. Resolves #19
1 parent df9f811 commit 09ddcdd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Sources/Atomics/AtomicStrongReference.swift

Lines changed: 3 additions & 5 deletions
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)