File tree Expand file tree Collapse file tree 6 files changed +4
-10
lines changed
library/std/src/sys/thread_local Expand file tree Collapse file tree 6 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl LazyKey {
34
34
LazyKey { key : AtomicUsize :: new ( KEY_SENTVAL ) , dtor }
35
35
}
36
36
37
- #[ inline( always ) ]
37
+ #[ inline]
38
38
pub fn force ( & self ) -> super :: Key {
39
39
match self . key . load ( Ordering :: Acquire ) {
40
40
KEY_SENTVAL => self . lazy_init ( ) as super :: Key ,
@@ -43,7 +43,6 @@ impl LazyKey {
43
43
}
44
44
45
45
#[ cold]
46
- #[ inline( never) ]
47
46
fn lazy_init ( & self ) -> usize {
48
47
// POSIX allows the key created here to be KEY_SENTVAL, but the compare_exchange
49
48
// below relies on using KEY_SENTVAL as a sentinel value to check who won the
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ impl LazyKey {
58
58
}
59
59
}
60
60
61
- #[ inline( always ) ]
61
+ #[ inline]
62
62
pub fn force ( & ' static self ) -> Key {
63
63
match self . key . load ( Acquire ) {
64
64
0 => unsafe { self . init ( ) } ,
@@ -67,7 +67,6 @@ impl LazyKey {
67
67
}
68
68
69
69
#[ cold]
70
- #[ inline( never) ]
71
70
unsafe fn init ( & ' static self ) -> Key {
72
71
if self . dtor . is_some ( ) {
73
72
let mut pending = c:: FALSE ;
Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ fn tls_table() -> &'static mut [*mut u8] {
93
93
}
94
94
95
95
#[ cold]
96
- #[ inline( never) ]
97
96
fn tls_table_slow ( ) -> & ' static mut [ * mut u8 ] {
98
97
// If the TP register is `0`, then this thread hasn't initialized
99
98
// its TLS yet. Allocate a new page to store this memory.
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ impl<T> Storage<T> {
28
28
///
29
29
/// # Safety
30
30
/// The `self` reference must remain valid until the TLS destructor is run.
31
- #[ inline( always ) ]
31
+ #[ inline]
32
32
pub unsafe fn get ( & self ) -> * const T {
33
33
if let State :: Alive = self . state . get ( ) {
34
34
self . val . get ( )
@@ -38,7 +38,6 @@ impl<T> Storage<T> {
38
38
}
39
39
40
40
#[ cold]
41
- #[ inline( never) ]
42
41
unsafe fn get_or_init_slow ( & self ) -> * const T {
43
42
match self . state . get ( ) {
44
43
State :: Uninitialized => { }
Original file line number Diff line number Diff line change 52
52
///
53
53
/// # Safety
54
54
/// The `self` reference must remain valid until the TLS destructor is run.
55
- #[ inline( always ) ]
55
+ #[ inline]
56
56
pub unsafe fn get_or_init ( & self , i : Option < & mut Option < T > > , f : impl FnOnce ( ) -> T ) -> * const T {
57
57
if let State :: Alive = self . state . get ( ) {
58
58
self . value . get ( ) . cast ( )
64
64
/// # Safety
65
65
/// The `self` reference must remain valid until the TLS destructor is run.
66
66
#[ cold]
67
- #[ inline( never) ]
68
67
unsafe fn get_or_init_slow (
69
68
& self ,
70
69
i : Option < & mut Option < T > > ,
Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ impl<T: 'static> Storage<T> {
86
86
/// * `key` must be the result of calling `self.key.force()`
87
87
/// * `ptr` must be the current value associated with `key`.
88
88
#[ cold]
89
- #[ inline( never) ]
90
89
unsafe fn try_initialize (
91
90
key : Key ,
92
91
ptr : * mut Value < T > ,
You can’t perform that action at this time.
0 commit comments