-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Task-local data should not require managed boxes #6004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Comments
Nominating this for a 1.0 milestone. |
Also we should not be using fns as keys, perhaps type descriptors |
Although not the same issue, #3273 has some interesting information which may be related to this (especially if there ends up being a complete rewrite of task-local data) |
bors
added a commit
that referenced
this issue
Jul 12, 2013
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).
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Sep 10, 2020
…, r=ebroto Simplify `clippy::default_trait_access` Remove repeated matching on the same QPath. changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
As written, using task local data at all, even to store owned data, involves allocating on the local heap, turning on the GC. Because of this, many tasks that otherwise would not use GC are forced to.
Rewrite the TLS implementation and interface to not require the local heap.
The text was updated successfully, but these errors were encountered: