Introduce a noncopyable Atomic<T> construct#94
Draft
lorentey wants to merge 14 commits intoapple:mainfrom
Draft
Conversation
Member
Author
|
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
6 tasks
Member
Author
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
RawLayoutfeature. (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 theAtomicgeneric, 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