mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
bpo-40521: Per-interpreter interned strings (GH-20085)
Make the Unicode dictionary of interned strings compatible with subinterpreters. Remove the INTERN_NAME_STRINGS macro in typeobject.c: names are always now interned (even if EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined). _PyUnicode_ClearInterned() now uses PyDict_Next() to no longer allocate memory, to ensure that the interned dictionary is cleared.
This commit is contained in:
parent
993e88cf08
commit
ea251806b8
5 changed files with 44 additions and 84 deletions
|
@ -1573,6 +1573,8 @@ finalize_interp_types(PyThreadState *tstate)
|
|||
_PyFrame_Fini(tstate);
|
||||
_PyAsyncGen_Fini(tstate);
|
||||
_PyContext_Fini(tstate);
|
||||
// Call _PyUnicode_ClearInterned() before _PyDict_Fini() since it uses
|
||||
// a dict internally.
|
||||
_PyUnicode_ClearInterned(tstate);
|
||||
|
||||
_PyDict_Fini(tstate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue