summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-12-26 01:58:33 (GMT)
committerGitHub <noreply@github.com>2020-12-26 01:58:33 (GMT)
commitea251806b8dffff11b30d2182af1e589caf88acf (patch)
tree10d413170c8e71dd19079b3d22eea4ebd5ddf7a5 /Python
parent993e88cf08994f7c1e0f9f62fda4ed32634ee2ad (diff)
downloadcpython-ea251806b8dffff11b30d2182af1e589caf88acf.zip
cpython-ea251806b8dffff11b30d2182af1e589caf88acf.tar.gz
cpython-ea251806b8dffff11b30d2182af1e589caf88acf.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index c3c1aa2..ccbacb4 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -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);