-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove GCX_PTR
.
#74969
Remove GCX_PTR
.
#74969
Conversation
I'm not totally confident about the new code in |
☔ The latest upstream changes (presumably #74726) made this pull request unmergeable. Please resolve the merge conflicts. |
cc #50699 ("Blocking Rayon queries") where r? @nikomatsakis |
Unfortunately #50699 has zero additional explanation beyond what is already in the code :( |
r=me with a rebase. |
We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows implicit access to a `GlobalCtxt` and some other things. We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same `GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR` is only used in the parallel compiler's `handle_deadlock()` function. This commit does the following. - It removes `GCX_PTR`. - It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now equivalent to the old `tls::enter_global()`. - Makes `tls::get_tlv()` public for the parallel compiler, because it's now used in `handle_deadlock()`.
I have rebased. @bors r=Mark-Simulacrum |
📌 Commit 8c78fd2 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Add a `CurrentGcx` type to let the deadlock handler access `TyCtxt` This brings back `GCX_PTR` (previously removed in rust-lang#74969) allowing the deadlock handler access to `GlobalCtxt`. This fixes rust-lang#111522. r? `@cjgillot`
We store an
ImplicitCtxt
pointer in a thread-local value (TLV). This allowsimplicit access to a
GlobalCtxt
and some other things.We also store a
GlobalCtxt
pointer inGCX_PTR
. This is always the sameGlobalCtxt
as the one within theImplicitCtxt
pointer in TLV.GCX_PTR
is only used in the parallel compiler's
handle_deadlock()
function.This commit does the following.
GCX_PTR
.ImplicitCtxt::new()
, which constructs anImplicitCtxt
from aGlobalCtxt
.ImplicitCtxt::new()
+tls::enter_context()
is nowequivalent to the old
tls::enter_global()
.tls::get_tlv()
public for the parallel compiler, because it'snow used in
handle_deadlock()
.r? @petrochenkov