Skip to content

Commit

Permalink
Auto merge of rust-lang#52281 - cramertj:fast-tls, r=alexcrichton
Browse files Browse the repository at this point in the history
Use fast TLS on Fuchsia

I'm not sure why Fuchsia was separated here, but we provide these symbols, and tests are passing in QEMU with this change. cc @raphlinus.

r? @alexcrichton
  • Loading branch information
bors committed Jul 13, 2018
2 parents 68c39b9 + a6fa656 commit 8b48b24
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/libstd/sys/unix/fast_thread_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// fallback implementation to use as well.
//
// Due to rust-lang/rust#18804, make sure this is not generic!
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "fuchsia"))]
pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
use libc;
use mem;
Expand Down Expand Up @@ -55,11 +55,6 @@ pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
_tlv_atexit(dtor, t);
}

// Just use the thread_local fallback implementation, at least until there's
// a more direct implementation.
#[cfg(target_os = "fuchsia")]
pub use sys_common::thread_local::register_dtor_fallback as register_dtor;

pub fn requires_move_before_drop() -> bool {
// The macOS implementation of TLS apparently had an odd aspect to it
// where the pointer we have may be overwritten while this destructor
Expand Down

0 comments on commit 8b48b24

Please sign in to comment.