Skip to content

Commit 92fa8e8

Browse files
committed
Don't use inline(never)
1 parent cf4669e commit 92fa8e8

File tree

6 files changed

+4
-10
lines changed

6 files changed

+4
-10
lines changed

library/std/src/sys/thread_local/key/racy.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl LazyKey {
3434
LazyKey { key: AtomicUsize::new(KEY_SENTVAL), dtor }
3535
}
3636

37-
#[inline(always)]
37+
#[inline]
3838
pub fn force(&self) -> super::Key {
3939
match self.key.load(Ordering::Acquire) {
4040
KEY_SENTVAL => self.lazy_init() as super::Key,
@@ -43,7 +43,6 @@ impl LazyKey {
4343
}
4444

4545
#[cold]
46-
#[inline(never)]
4746
fn lazy_init(&self) -> usize {
4847
// POSIX allows the key created here to be KEY_SENTVAL, but the compare_exchange
4948
// below relies on using KEY_SENTVAL as a sentinel value to check who won the

library/std/src/sys/thread_local/key/windows.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl LazyKey {
5858
}
5959
}
6060

61-
#[inline(always)]
61+
#[inline]
6262
pub fn force(&'static self) -> Key {
6363
match self.key.load(Acquire) {
6464
0 => unsafe { self.init() },
@@ -67,7 +67,6 @@ impl LazyKey {
6767
}
6868

6969
#[cold]
70-
#[inline(never)]
7170
unsafe fn init(&'static self) -> Key {
7271
if self.dtor.is_some() {
7372
let mut pending = c::FALSE;

library/std/src/sys/thread_local/key/xous.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ fn tls_table() -> &'static mut [*mut u8] {
9393
}
9494

9595
#[cold]
96-
#[inline(never)]
9796
fn tls_table_slow() -> &'static mut [*mut u8] {
9897
// If the TP register is `0`, then this thread hasn't initialized
9998
// its TLS yet. Allocate a new page to store this memory.

library/std/src/sys/thread_local/native/eager.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<T> Storage<T> {
2828
///
2929
/// # Safety
3030
/// The `self` reference must remain valid until the TLS destructor is run.
31-
#[inline(always)]
31+
#[inline]
3232
pub unsafe fn get(&self) -> *const T {
3333
if let State::Alive = self.state.get() {
3434
self.val.get()
@@ -38,7 +38,6 @@ impl<T> Storage<T> {
3838
}
3939

4040
#[cold]
41-
#[inline(never)]
4241
unsafe fn get_or_init_slow(&self) -> *const T {
4342
match self.state.get() {
4443
State::Uninitialized => {}

library/std/src/sys/thread_local/native/lazy.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ where
5252
///
5353
/// # Safety
5454
/// The `self` reference must remain valid until the TLS destructor is run.
55-
#[inline(always)]
55+
#[inline]
5656
pub unsafe fn get_or_init(&self, i: Option<&mut Option<T>>, f: impl FnOnce() -> T) -> *const T {
5757
if let State::Alive = self.state.get() {
5858
self.value.get().cast()
@@ -64,7 +64,6 @@ where
6464
/// # Safety
6565
/// The `self` reference must remain valid until the TLS destructor is run.
6666
#[cold]
67-
#[inline(never)]
6867
unsafe fn get_or_init_slow(
6968
&self,
7069
i: Option<&mut Option<T>>,

library/std/src/sys/thread_local/os.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl<T: 'static> Storage<T> {
8686
/// * `key` must be the result of calling `self.key.force()`
8787
/// * `ptr` must be the current value associated with `key`.
8888
#[cold]
89-
#[inline(never)]
9089
unsafe fn try_initialize(
9190
key: Key,
9291
ptr: *mut Value<T>,

0 commit comments

Comments
 (0)