Skip to content

Commit 53f1468

Browse files
committed
Update strict memory safety annotations for Synchronization module
1 parent 9f2859e commit 53f1468

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

stdlib/public/Synchronization/Atomics/AtomicPointers.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extension UnsafePointer: @unsafe AtomicRepresentable where Pointee: ~Copyable {
3737
public static func encodeAtomicRepresentation(
3838
_ value: consuming UnsafePointer<Pointee>
3939
) -> AtomicRepresentation {
40-
unsafe Int.encodeAtomicRepresentation(
40+
Int.encodeAtomicRepresentation(
4141
Int(bitPattern: value)
4242
)
4343
}
@@ -88,7 +88,7 @@ extension UnsafePointer: @unsafe AtomicOptionalRepresentable where Pointee: ~Cop
8888
public static func encodeAtomicOptionalRepresentation(
8989
_ value: consuming UnsafePointer<Pointee>?
9090
) -> AtomicOptionalRepresentation {
91-
unsafe Int.encodeAtomicRepresentation(
91+
Int.encodeAtomicRepresentation(
9292
Int(bitPattern: value)
9393
)
9494
}
@@ -143,7 +143,7 @@ extension UnsafeMutablePointer: @unsafe AtomicRepresentable where Pointee: ~Copy
143143
public static func encodeAtomicRepresentation(
144144
_ value: consuming UnsafeMutablePointer<Pointee>
145145
) -> AtomicRepresentation {
146-
unsafe Int.encodeAtomicRepresentation(
146+
Int.encodeAtomicRepresentation(
147147
Int(bitPattern: value)
148148
)
149149
}
@@ -195,7 +195,7 @@ where Pointee: ~Copyable {
195195
public static func encodeAtomicOptionalRepresentation(
196196
_ value: consuming UnsafeMutablePointer<Pointee>?
197197
) -> AtomicOptionalRepresentation {
198-
unsafe Int.encodeAtomicRepresentation(
198+
Int.encodeAtomicRepresentation(
199199
Int(bitPattern: value)
200200
)
201201
}
@@ -250,7 +250,7 @@ extension UnsafeRawPointer: @unsafe AtomicRepresentable {
250250
public static func encodeAtomicRepresentation(
251251
_ value: consuming UnsafeRawPointer
252252
) -> AtomicRepresentation {
253-
unsafe Int.encodeAtomicRepresentation(
253+
Int.encodeAtomicRepresentation(
254254
Int(bitPattern: value)
255255
)
256256
}
@@ -301,7 +301,7 @@ extension UnsafeRawPointer: @unsafe AtomicOptionalRepresentable {
301301
public static func encodeAtomicOptionalRepresentation(
302302
_ value: consuming UnsafeRawPointer?
303303
) -> AtomicOptionalRepresentation {
304-
unsafe Int.encodeAtomicRepresentation(
304+
Int.encodeAtomicRepresentation(
305305
Int(bitPattern: value)
306306
)
307307
}
@@ -356,7 +356,7 @@ extension UnsafeMutableRawPointer: @unsafe AtomicRepresentable {
356356
public static func encodeAtomicRepresentation(
357357
_ value: consuming UnsafeMutableRawPointer
358358
) -> AtomicRepresentation {
359-
unsafe Int.encodeAtomicRepresentation(
359+
Int.encodeAtomicRepresentation(
360360
Int(bitPattern: value)
361361
)
362362
}
@@ -407,7 +407,7 @@ extension UnsafeMutableRawPointer: @unsafe AtomicOptionalRepresentable {
407407
public static func encodeAtomicOptionalRepresentation(
408408
_ value: consuming UnsafeMutableRawPointer?
409409
) -> AtomicOptionalRepresentation {
410-
unsafe Int.encodeAtomicRepresentation(
410+
Int.encodeAtomicRepresentation(
411411
Int(bitPattern: value)
412412
)
413413
}
@@ -798,7 +798,7 @@ extension UnsafeBufferPointer: @unsafe AtomicRepresentable where Element: ~Copya
798798
) -> AtomicRepresentation {
799799
let valueCopy = unsafe value
800800

801-
return unsafe WordPair.encodeAtomicRepresentation(
801+
return WordPair.encodeAtomicRepresentation(
802802
WordPair(
803803
first: UInt(bitPattern: valueCopy.baseAddress),
804804
second: UInt(truncatingIfNeeded: valueCopy.count)
@@ -866,7 +866,7 @@ where Element: ~Copyable
866866
) -> AtomicRepresentation {
867867
let valueCopy = unsafe value
868868

869-
return unsafe WordPair.encodeAtomicRepresentation(
869+
return WordPair.encodeAtomicRepresentation(
870870
WordPair(
871871
first: UInt(bitPattern: valueCopy.baseAddress),
872872
second: UInt(truncatingIfNeeded: valueCopy.count)
@@ -932,7 +932,7 @@ extension UnsafeRawBufferPointer: @unsafe AtomicRepresentable {
932932
) -> AtomicRepresentation {
933933
let valueCopy = unsafe value
934934

935-
return unsafe WordPair.encodeAtomicRepresentation(
935+
return WordPair.encodeAtomicRepresentation(
936936
WordPair(
937937
first: UInt(bitPattern: valueCopy.baseAddress),
938938
second: UInt(truncatingIfNeeded: valueCopy.count)
@@ -998,7 +998,7 @@ extension UnsafeMutableRawBufferPointer: @unsafe AtomicRepresentable {
998998
) -> AtomicRepresentation {
999999
let valueCopy = unsafe value
10001000

1001-
return unsafe WordPair.encodeAtomicRepresentation(
1001+
return WordPair.encodeAtomicRepresentation(
10021002
WordPair(
10031003
first: UInt(bitPattern: valueCopy.baseAddress),
10041004
second: UInt(truncatingIfNeeded: valueCopy.count)

0 commit comments

Comments
 (0)