From 9fd2ac7428afa4f414f32b8b4876ca817ee85f16 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 14 Jul 2013 01:43:31 -0700 Subject: Make TLS keys actually take up space If the TLS key is 0-sized, then the linux linker is apparently smart enough to put everything at the same pointer. OSX on the other hand, will reserve some space for all of them. To get around this, the TLS key now actuall consumes space to ensure that it gets a unique pointer --- src/libsyntax/ext/expand.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 4fbc3862848..b45cde6a8e3 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -580,7 +580,9 @@ pub fn core_macros() -> @str { pub mod $c { #[allow(non_uppercase_statics)]; - static key: &'static [@::std::condition::Handler<$in, $out>] = &[]; + static key: ::std::local_data::Key< + @::std::condition::Handler<$in, $out>> = + &::std::local_data::Key; pub static cond : ::std::condition::Condition<$in,$out> = @@ -596,7 +598,9 @@ pub fn core_macros() -> @str { // FIXME (#6009): remove mod's `pub` below once variant above lands. pub mod $c { #[allow(non_uppercase_statics)]; - static key: &'static [@::std::condition::Handler<$in, $out>] = &[]; + static key: ::std::local_data::Key< + @::std::condition::Handler<$in, $out>> = + &::std::local_data::Key; pub static cond : ::std::condition::Condition<$in,$out> = -- cgit 1.4.1-3-g733a5