We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 72d0be4 + 847f461 commit 5b2ad6eCopy full SHA for 5b2ad6e
library/std/src/sys/windows/thread_local_dtor.rs
@@ -8,10 +8,14 @@
8
#[thread_local]
9
static mut DESTRUCTORS: Vec<(*mut u8, unsafe extern "C" fn(*mut u8))> = Vec::new();
10
11
+// Ensure this can never be inlined because otherwise this may break in dylibs.
12
+// See #44391.
13
+#[inline(never)]
14
pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
15
DESTRUCTORS.push((t, dtor));
16
}
17
18
+#[inline(never)] // See comment above
19
/// Runs destructors. This should not be called until thread exit.
20
pub unsafe fn run_keyless_dtors() {
21
// Drop all the destructors.
0 commit comments