]> git.lizzy.rs Git - rust.git/commit - library/core/src/slice/memchr.rs
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
authorbors <bors@rust-lang.org>
Thu, 13 Oct 2022 06:49:29 +0000 (06:49 +0000)
committerbors <bors@rust-lang.org>
Thu, 13 Oct 2022 06:49:29 +0000 (06:49 +0000)
commitfa0ca783f89a83046e6ce0383385ba5b28296435
treebdb171fd02b693ed091c393d4d284981c0b9b3f4
parent3cf5fc58d56adeee42abb7e5059c718b0a86857d
parentd4578013541a5c6ae34b62a83e8dcb11fb6d4b05
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton

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).
library/std/src/sys/windows/c.rs
library/std/src/sys_common/mod.rs