Skip to content

Commit 0aef121

Browse files
committed
mention that atomic-maybe-uninit is being used to work around this
1 parent 3449447 commit 0aef121

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/deliberate-ub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We should evaluate whether there truly is some use-case here that is not current
1818
It is not clear how to best specify a useful `compare_exchange` that can work on padding bytes,
1919
see the [discussion here](https://github.com/rust-lang/unsafe-code-guidelines/issues/449).<br>
2020
The alternative is to not use the "fast path" for problematic types (and fall back to the SeqLock), but that requires some way to query at `const`-time whether the type contains padding (or provenance).
21-
(Or of course one can use inline assembly, but it would be better if that was not required.)
21+
(Or of course one can use inline assembly, but it would be better if that was not required. This is in fact what crossbeam now does, via [atomic-maybe-uninit](https://github.com/taiki-e/atomic-maybe-uninit).)
2222
* crossbeam's deque uses [volatile accesses that really should be atomic instead](https://github.com/crossbeam-rs/crossbeam/blob/5a154def002304814d50f3c7658bd30eb46b2fad/crossbeam-deque/src/deque.rs#L70-L88).
2323
They cannot use atomic accesses as those are not possible for arbitrary `T`.
2424
This would be resolved by bytewise atomic memcpy.

0 commit comments

Comments
 (0)