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.
--cfg portable_atomic_unsafe_atomic_builtins
Use
__atomic_*
builtins.Combine this with custom atomic logic and you can support CAS on multi-core systems where atomic CAS is not available in the standard library.
Note: This cfg is
unsafe
.This cfg enables pointer-width and smaller atomic types.
To enable atomic types grater than pointer-width, you need to enable
--cfg portable_atomic_unsafe_atomic_builtins_N
cfgs.--cfg portable_atomic_unsafe_atomic_builtins_N
Similar to
--cfg portable_atomic_unsafe_atomic_builtins
, but also enables the specified size and smaller atomic types if the pointer width is smaller than the specified size.For example, when
--cfg portable_atomic_unsafe_atomic_builtins_4
is enabled:Atomic{I,U}{64,32,16,8}
will be enabled.Atomic{I,U}{32,16,8}
will be enabled.N
is in bytes and must be 4, 8, or 16. In other words, there are three valid patterns:cc #26, #33