We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fe989e9 + a80d390 commit f2d9579Copy full SHA for f2d9579
library/std/src/thread/local.rs
@@ -424,10 +424,9 @@ pub mod fast {
424
// thread_local's, or it is being recursively initialized.
425
//
426
// Macos: Inlining this function can cause two `tlv_get_addr` calls to
427
- // be performed for every call to `Key::get`. The #[cold] hint makes
428
- // that less likely.
+ // be performed for every call to `Key::get`.
429
// LLVM issue: https://bugs.llvm.org/show_bug.cgi?id=41722
430
- #[cold]
+ #[inline(never)]
431
unsafe fn try_initialize<F: FnOnce() -> T>(&self, init: F) -> Option<&'static T> {
432
if !mem::needs_drop::<T>() || self.try_register_dtor() {
433
Some(self.inner.initialize(init))
0 commit comments