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
This commit is contained in:
Alex Crichton
2013-07-14 01:43:31 -07:00
parent e3211fa1f1
commit 9fd2ac7428
16 changed files with 81 additions and 70 deletions

View File

@@ -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> =