-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
[3.12] gh-110310: Add a Per-Interpreter XID Registry for Heap Types (gh-110311) #110714
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
[3.12] gh-110310: Add a Per-Interpreter XID Registry for Heap Types (gh-110311) #110714
Conversation
…ypes (pythongh-110311) We do the following: * add a per-interpreter XID registry (PyInterpreterState.xidregistry) * put heap types there (keep static types in _PyRuntimeState.xidregistry) * clear the registries during interpreter/runtime finalization * avoid duplicate entries in the registry (when _PyCrossInterpreterData_RegisterClass() is called more than once for a type) * use Py_TYPE() instead of PyObject_Type() in _PyCrossInterpreterData_Lookup() The per-interpreter registry helps preserve isolation between interpreters. This is important when heap types are registered, which is something we haven't been doing yet but I will likely do soon. (cherry-picked from commit 80dc39e)
Can you elaborate (in this PR or in a news item) what this actually fixes? The PR description says it's important for a future change, which makes me wonder if the future change is reasonable for 3.12 and whether this is actually necessary. |
With that I was referring specifically to the |
We do the following:
The per-interpreter registry helps preserve isolation between interpreters. This is important when heap types are registered, which is something we haven't been doing yet but I will likely do soon.
(cherry-picked from commit 80dc39e)