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

@@ -695,7 +695,7 @@ pub fn new_sctable_internal() -> SCTable {
// fetch the SCTable from TLS, create one if it doesn't yet exist.
pub fn get_sctable() -> @mut SCTable {
#[cfg(not(stage0))]
static sctable_key: local_data::Key<@@mut SCTable> = &[];
static sctable_key: local_data::Key<@@mut SCTable> = &local_data::Key;
#[cfg(stage0)]
fn sctable_key(_: @@mut SCTable) {}
match local_data::get(sctable_key, |k| k.map(|&k| *k)) {