diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-07-14 01:43:31 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-07-14 10:15:07 -0700 |
| commit | 9fd2ac7428afa4f414f32b8b4876ca817ee85f16 (patch) | |
| tree | d95eb9acc27f980f2365330b3aa9566e8eec2010 /src/libstd/rt/task.rs | |
| parent | e3211fa1f1f24268b91b0c89cb312e70499d41f3 (diff) | |
| download | rust-9fd2ac7428afa4f414f32b8b4876ca817ee85f16.tar.gz rust-9fd2ac7428afa4f414f32b8b4876ca817ee85f16.zip | |
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
Diffstat (limited to 'src/libstd/rt/task.rs')
| -rw-r--r-- | src/libstd/rt/task.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 0fd8c5c03d3..17d0d59660f 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -348,10 +348,10 @@ mod test { fn tls() { use local_data; do run_in_newsched_task() { - static key: local_data::Key<@~str> = &[]; + static key: local_data::Key<@~str> = &local_data::Key; local_data::set(key, @~"data"); assert!(*local_data::get(key, |k| k.map(|&k| *k)).get() == ~"data"); - static key2: local_data::Key<@~str> = &[]; + static key2: local_data::Key<@~str> = &local_data::Key; local_data::set(key2, @~"data"); assert!(*local_data::get(key2, |k| k.map(|&k| *k)).get() == ~"data"); } |
