-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a noncopyable Atomic<T> construct #94
base: main
Are you sure you want to change the base?
Conversation
CI is going to fail, but just for fun: @swift-ci test |
7d4c7d8
to
216a4b5
Compare
… → AtomicReference
- De-gyb sources. - Introduce noncopyable variant, `AtomicLazyReference`. - Reformulate `ManagedAtomicLazyReference` in terms of `AtomicLazyReference`.
…e atomics when they exist
f104af1
to
2450667
Compare
This does work well, but I don't expect we'll land it in this form. We are planning to radically streamline the 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 |
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.)The code is triggering compiler assertions all over the place. These need to be reported and fixed (or worked around).Support is now (almost?) working.@_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.)Checklist