rust/library/std/src/sys
Chris Denton a9f8f8b070
Rollup merge of #122583 - Zoxc:tls-non-mut, r=joboet
Use `UnsafeCell` for fast constant thread locals

This uses `UnsafeCell` instead of `static mut` for fast constant thread locals. This changes the type of the TLS shims to return `&UnsafeCell<T>` instead of `*mut T` which means they are always non-null so LLVM can optimize away the check for `Some` in `LocalKey::with` if `T` has no destructor.

LLVM is currently unable to do this optimization as we lose the fact that `__getit` always returns `Some` as it gets optimized to just returning the value of the TLS shim.
2024-03-16 18:27:34 +00:00
..
os_str Move OsStr::slice_encoded_bytes validation to platform modules 2024-01-21 19:51:49 +01:00
pal Rollup merge of #122390 - ChrisDenton:bindgen, r=Mark-Simulacrum 2024-03-16 18:27:33 +00:00
path std: move path into sys 2024-02-08 12:51:35 +01:00
personality std support for wasm32 panic=unwind 2024-02-22 16:45:26 -06:00
sync std: move Once implementations to sys 2024-03-12 15:41:06 +01:00
thread_local Use UnsafeCell for fast constant thread locals 2024-03-16 12:34:52 +01:00
cmath.rs Make cmath.rs a single file 2024-02-07 12:02:24 -03:00
mod.rs std: move Once implementations to sys 2024-03-12 15:41:06 +01:00