More fixes

This commit is contained in:
Nate Cook committed 2025-03-06 09:11:37 -06:00
1 parent b6bc543abb
commit 9ea086d683
5 files changed
+6 -6

No files matched your search

@@ -282,7 +282,8 @@ internal struct _AtomicReferenceStorage {
assert(current._readers == old._readers)
assert(current._raw == old._raw)
assert(current._readers <= delta)
ref.release(by: delta - current._readers + 1) // +1 is for our own role as a reader.
// +1 is for our own role as a reader.
ref.release(by: delta - current._readers + 1)
return (true, ref.takeRetainedValue())
}
if current._version != old._version {
+1 -1
View File
@@ -15,5 +15,5 @@
public protocol AtomicValue {
/// The atomic storage representation for this value.
associatedtype AtomicRepresentation: AtomicStorage
/* where Self is a subtype of AtomicRepresentation.Value */
// where Self is a subtype of AtomicRepresentation.Value
}
@@ -22,6 +22,7 @@ where Value.AtomicRepresentation.Value == Value {
@usableFromInline
internal typealias _Storage = Value.AtomicRepresentation
// swift-format-ignore: AlwaysUseLowerCamelCase
/// The atomic representation of the value stored inside.
///
/// Warning: This ivar must only ever be accessed via `_ptr` after
@@ -11,9 +11,11 @@
//===----------------------------------------------------------------------===//
#if ATOMICS_SINGLE_MODULE
// swift-format-ignore: AlwaysUseLowerCamelCase
@_silgen_name("_sa_retain_n")
internal func _sa_retain_n(_ object: UnsafeMutableRawPointer, _ delta: UInt32)
// swift-format-ignore: AlwaysUseLowerCamelCase
@_silgen_name("_sa_release_n")
internal func _sa_release_n(_ object: UnsafeMutableRawPointer, _ delta: UInt32)
#else
@@ -50,10 +50,6 @@ enum Fred: Int, AtomicValue {
struct Hyacinth: RawRepresentable, Equatable, AtomicOptionalWrappable {
var rawValue: UnsafeRawPointer
init(rawValue: UnsafeRawPointer) {
self.rawValue = rawValue
}
static let bucket: Hyacinth = Hyacinth(
rawValue: UnsafeMutableRawPointer.allocate(byteCount: 8, alignment: 8))
}