mirror of
https://github.com/apple/swift-atomics
synced 2026-11-25 04:37:47 +00:00
Update Sources/Atomics/AtomicOptionalRawRepresentable.swift
state the layout compatibility guarantee Co-authored-by: Karoy Lorentey <klorentey@apple.com>
This commit is contained in:
1 parent
ae5e639014
commit
e47d14acfb
1 file changed
+1
@@ -44,6 +44,7 @@ public struct AtomicOptionalRawRepresentableStorage<Wrapped>: AtomicStorage
|
||||
static func _extract(
|
||||
_ ptr: UnsafeMutablePointer<Self>
|
||||
) -> UnsafeMutablePointer<Storage> {
|
||||
// `Self` is layout-compatible with its only stored property.
|
||||
return UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: Storage.self)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user