diff options
| author | bors <bors@rust-lang.org> | 2022-02-27 01:23:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-02-27 01:23:48 +0000 |
| commit | 035a717ee8bf548868fb50b5c7ca562fc4a657a7 (patch) | |
| tree | cdb466d9ea6519b5f57aafb8faa73749906cef1d | |
| parent | 761e8884858759b21f3374ad610494e68c087a38 (diff) | |
| parent | 2d6d30f4a86682f351149d9ad24a6a132c026362 (diff) | |
| download | rust-035a717ee8bf548868fb50b5c7ca562fc4a657a7.tar.gz rust-035a717ee8bf548868fb50b5c7ca562fc4a657a7.zip | |
Auto merge of #94373 - erikdesjardins:getitinl, r=Mark-Simulacrum
Make TLS __getit #[inline(always)] on non-Windows This may improve perf, and/or stop `externs` perf benchmarks from being flaky. r? `@ghost`
| -rw-r--r-- | library/std/src/thread/local.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 1be3ed757ba..2464a0e2e47 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -177,7 +177,7 @@ macro_rules! thread_local { macro_rules! __thread_local_inner { // used to generate the `LocalKey` value for const-initialized thread locals (@key $t:ty, const $init:expr) => {{ - #[cfg_attr(not(windows), inline)] // see comments below + #[cfg_attr(not(windows), inline(always))] // see comments below unsafe fn __getit() -> $crate::option::Option<&'static $t> { const INIT_EXPR: $t = $init; @@ -297,7 +297,7 @@ macro_rules! __thread_local_inner { // gets the pessimistic path for now where it's never inlined. // // The issue of "should enable on Windows sometimes" is #84933 - #[cfg_attr(not(windows), inline)] + #[cfg_attr(not(windows), inline(always))] unsafe fn __getit() -> $crate::option::Option<&'static $t> { #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] static __KEY: $crate::thread::__StaticLocalKeyInner<$t> = |
