rust/library/std
bors 467250ddb2 Auto merge of #144465 - orlp:system-alloc-tls, r=Mark-Simulacrum
Allow the global allocator to use thread-local storage and std:🧵:current()

Fixes https://github.com/rust-lang/rust/issues/115209.

Currently the thread-local storage implementation uses the `Global` allocator if it needs to allocate memory in some places. This effectively means the global allocator can not use thread-local variables. This is a shame as an allocator is precisely one of the locations where you'd *really* want to use thread-locals. We also see that this lead to hacks such as https://github.com/rust-lang/rust/pull/116402, where we detect re-entrance and abort.

So I've made the places where I could find allocation happening in the TLS implementation use the `System` allocator instead. I also applied this change to the storage allocated for a `Thread` handle so that it may be used care-free in the global allocator as well, for e.g. registering it to a central place or parking primitives.

r? `@joboet`
2025-11-29 02:08:53 +00:00
..
benches benchmark path.components() iteration 2025-10-25 14:46:58 +02:00
src Auto merge of #144465 - orlp:system-alloc-tls, r=Mark-Simulacrum 2025-11-29 02:08:53 +00:00
tests rustc_target: aarch64: Remove deprecated FEAT_TME 2025-11-25 00:43:01 +00:00
build.rs Add Motor OS std library port 2025-10-08 08:57:58 -07:00
Cargo.toml library: upgrade to hashbrown v0.16.1 2025-11-20 11:12:31 -08:00