]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwalton
authorbors <bors@rust-lang.org>
Fri, 12 Jul 2013 02:52:37 +0000 (19:52 -0700)
committerbors <bors@rust-lang.org>
Fri, 12 Jul 2013 02:52:37 +0000 (19:52 -0700)
cc #6004 and #3273

This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats:

1. Changing `local_set` to not require `@` is blocked on #7673
2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it...

The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed.

This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).

1  2 
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/context.rs
src/libstd/os.rs
src/libstd/rand.rs
src/libstd/rt/task.rs
src/libstd/task/mod.rs
src/libstd/task/spawn.rs
src/rt/rust_builtin.cpp
src/rt/rustrt.def.in

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index ea614330866fe5358de7bcbc868153dd7c42334e,55caf038227399099edeee97b0a1e84c3486db54..a13b1d6015bdebbba77f36830f803575bacaf140
@@@ -265,10 -238,3 +264,10 @@@ rust_take_env_loc
  rust_drop_env_lock
  rust_update_log_settings
  rust_running_on_valgrind
- rust_get_exit_status_newrt
 +rust_get_num_cpus
 +rust_get_global_args_ptr
 +rust_current_boxed_region
 +rust_take_global_args_lock
 +rust_drop_global_args_lock
 +rust_set_exit_status_newrt
++rust_get_exit_status_newrt