Open lorentey opened 1 year ago
CI is going to fail, but just for fun:
@swift-ci test
This does work well, but I don't expect we'll land it in this form.
We are planning to radically streamline the AtomicValue
protocol for the stdlib proposal, and I expect we'll want to land a "packagized" version of that as a brand new module (SynchronizationPackage
), completely replacing the current API surface. (Perhaps the new module will ship in a new package, even.)
The nice thing is that most client code that isn't defining its own atomics from scratch will survive without any changes. (Other than changing the import statement and replacing Unsafe
/ManagedAtomic
with Atomic
, of course.)
Now that we have
@_rawLayout
, it is now possible to start drafting the move-onlyAtomic<Value>
type we always wanted.This is an early experiment that isn't ready for prime time yet:
RawLayout
feature. (It is currently experimentally available on swift's main branch, which still identifies itself as Swift 5.9.)@_rawLayout(like:)
currently does not support picking up the layout type from the type argument of theAtomic
generic, so this PR unconditionally widens the type's layout to the maximum possible atomic width. (I.e., we use double-wide layout even if we only need to store a single byte's worth of data.)~ Support is now (almost?) working.Checklist