diff options
| author | Chris Denton <christophersdenton@gmail.com> | 2022-08-01 01:46:49 +0100 |
|---|---|---|
| committer | Chris Denton <christophersdenton@gmail.com> | 2022-08-01 03:53:16 +0100 |
| commit | 847f4613e0a60ce657924439f9339706911bbfab (patch) | |
| tree | 83b18d9086227e09181d0215f118422a5602adb6 /library/std/src/sys | |
| parent | f9cba63746d0fff816250b2ba7b706b5d4dcf000 (diff) | |
| download | rust-847f4613e0a60ce657924439f9339706911bbfab.tar.gz rust-847f4613e0a60ce657924439f9339706911bbfab.zip | |
Never inline Windows dtor access
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/windows/thread_local_dtor.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/thread_local_dtor.rs b/library/std/src/sys/windows/thread_local_dtor.rs index 25d1c6e8e87..9707a95dff2 100644 --- a/library/std/src/sys/windows/thread_local_dtor.rs +++ b/library/std/src/sys/windows/thread_local_dtor.rs @@ -8,10 +8,14 @@ #[thread_local] static mut DESTRUCTORS: Vec<(*mut u8, unsafe extern "C" fn(*mut u8))> = Vec::new(); +// Ensure this can never be inlined because otherwise this may break in dylibs. +// See #44391. +#[inline(never)] pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { DESTRUCTORS.push((t, dtor)); } +#[inline(never)] // See comment above /// Runs destructors. This should not be called until thread exit. pub unsafe fn run_keyless_dtors() { // Drop all the destructors. |
