rust/library/alloc/src
Jacob Pratt 43ad753adb
Rollup merge of #122729 - m-ou-se:relax, r=Amanieu
Relax SeqCst ordering in standard library.

Every single SeqCst in the standard library is unnecessary. In all cases, Relaxed or Release+Acquire was sufficient.

As I [wrote](https://marabos.nl/atomics/memory-ordering.html#common-misconceptions) in my book on atomics:

> [..] when reading code, SeqCst basically tells the reader: "this operation depends on the total order of every single SeqCst operation in the program," which is an incredibly far-reaching claim. The same code would likely be easier to review and verify if it used weaker memory ordering instead, if possible. For example, Release effectively tells the reader: "this relates to an acquire operation on the same variable," which involves far fewer considerations when forming an understanding of the code.
>
> It is advisable to see SeqCst as a warning sign. Seeing it in the wild often means that either something complicated is going on, or simply that the author did not take the time to analyze their memory ordering related assumptions, both of which are reasons for extra scrutiny.

r? ````@Amanieu```` ````@joboet````
2024-03-20 20:29:44 -04:00
..
alloc run alloc benchmarks in Miri and fix UB 2022-11-07 10:34:04 +01:00
boxed library: use addr_of! 2024-02-24 16:02:17 +03:00
collections Rollup merge of #120504 - kornelski:try_with_capacity, r=Amanieu 2024-03-09 21:40:06 +01:00
ffi Rollup merge of #112136 - clarfonthey:ffi-c_str, r=cuviper 2024-03-10 10:58:14 +01:00
raw_vec try_with_capacity for RawVec 2024-03-01 18:20:48 +00:00
rc remove redundant imports 2023-12-10 10:56:22 +08:00
slice ignore core, alloc and test tests that require unwinding on panic=abort 2023-06-13 15:53:24 +02:00
sync Fix some Arc allocator leaks 2024-01-28 18:33:34 +01:00
testing Share testing utilities with non-btree test cases 2022-05-02 10:07:50 +02:00
vec fix OOB pointer formed in Vec::index 2024-03-19 22:47:35 -05:00
alloc.rs step cfgs 2024-03-20 08:49:13 -04:00
borrow.rs Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
boxed.rs Only split by-ref/by-move futures for async closures 2024-03-19 16:59:23 -04:00
fmt.rs docs: use correct link, use secondary example 2024-02-12 20:17:47 -05:00
lib.rs Auto merge of #122055 - compiler-errors:stabilize-atb, r=oli-obk 2024-03-19 00:04:09 +00:00
macros.rs Update doc for alloc::format! and core::concat! 2023-09-06 15:11:21 +02:00
raw_vec.rs RawVec::into_box: avoid unnecessary intermediate reference 2024-03-10 18:07:34 +01:00
rc.rs Rollup merge of #121287 - zachs18:rc-into-raw-must-use, r=cuviper 2024-03-05 06:40:30 +01:00
slice.rs Add slice::try_range 2024-02-15 10:18:33 -05:00
str.rs Export core::str::from_raw_parts{,_mut} into alloc::str and std::str 2024-01-25 18:11:54 -08:00
string.rs try_with_capacity for Vec, VecDeque, String 2024-03-01 18:24:02 +00:00
sync.rs SeqCst->Relaxed in doc examples. 2024-03-19 15:27:11 +01:00
task.rs Generate original vtable and clone's vtable in the same CGU 2024-02-26 20:56:44 -08:00
tests.rs remove redundant imports 2023-12-10 10:56:22 +08:00