Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMake AtomicBool the same size as bool #32365
Conversation
rust-highfive
assigned
alexcrichton
Mar 20, 2016
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
The impl looks okay to me. The comment regarding CAS loop also seems to be true, and LLVM won’t accept something like |
This comment has been minimized.
This comment has been minimized.
|
I'd be a little nervous to land this ahead of rust-lang/rfcs#1543 and rust-lang/rfcs#1505, but it seems fine to me in principle. I'm tagging with |
alexcrichton
added
the
T-libs
label
Mar 21, 2016
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this during triage yesterday, and some of our discussion led to some surprising conclusions, but in general we felt a little uncomfortable merging this ahead of rust-lang/rfcs#1543. In light of that, we're thinking that we may want to hold off on this for now until we move on one of those RFCs |
This comment has been minimized.
This comment has been minimized.
|
Ok, we discussed this again in light of accepting rust-lang/rfcs#1543, but we concluded that we probably don't want to do this at this time due to the uncertainty about what to do with platform-specific types. We can certainly revisit this though once the types become stable! |
alexcrichton
closed this
Apr 15, 2016
This comment has been minimized.
This comment has been minimized.
|
I don't think platform-specific types are relevant here since any platform that supports pointer-sized atomics will always support byte-sized atomics. Changing the size of AtomicBool to 1 byte will therefore not introduce any compatibility issues. |
Amanieu commentedMar 20, 2016
This allows
AtomicBoolto be transmuted to abool, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a validboolvalue, which wasn't the case before (due tofetch_nand).