Convert rbimpl_atomic_* to use explicit memory ordering #14036
+164
−117
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.
This replaces the existing
rbimpl_atomic_*
helpers to all take an explicit memory ordering.rbimpl_
are meant to be private changing at any time, so we shouldn't consider this a change to the public API.I made a previous attempt in #13974. Compared to that this replaces the existing rbimpl_ macros instead of adding new _explicit versions. I think that turned out a lot simpler. Although there are many lines changed, it's a very consistent change.
This adds memory ordering only for gcc's
__atomic
(which llvm also supports) and the C11stdatomic.h
. For other cases we have arbitrary values for the memory order and they are ignored, which we expect to give the equivalent ofSEQ_CST
.