mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 12:40:14 +03:00
fa0ca783f8
Optimize TLS on Windows This implements the suggestion in the current TLS code to embed the linked list of destructors in the `StaticKey` structure to save allocations. Additionally, locking is avoided when no destructor needs to be run. By using one Windows-provided `Once` per key instead of a global lock, locking is more finely-grained (this unblocks #100579).