diff options
author | Victor Stinner <vstinner@python.org> | 2022-01-06 15:12:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 15:12:28 (GMT) |
commit | 72c260cf0c71eb01eb13100b751e9d5007d00b70 (patch) | |
tree | 7aa9f23f175630b1b53ef57ae3a7896d886fa8b4 /Include | |
parent | 861a9aaf0f517623c58ca4eb5588804b2632fcba (diff) | |
download | cpython-72c260cf0c71eb01eb13100b751e9d5007d00b70.zip cpython-72c260cf0c71eb01eb13100b751e9d5007d00b70.tar.gz cpython-72c260cf0c71eb01eb13100b751e9d5007d00b70.tar.bz2 |
[3.10] bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) (GH-30425)
This reverts commit ea251806b8dffff11b30d2182af1e589caf88acf.
Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for
the main interpreter.
Keep _PyUnicode_ClearInterned() changes avoiding the creation of a
temporary Python list object.
Leave the PyInterpreterState structure unchanged to keep the ABI
backward compatibility with Python 3.10.0: rename the "interned"
member to "unused_interned".
(cherry picked from commit 35d6540c904ef07b8602ff014e520603f84b5886)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_interp.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index bfd082b..4307b61 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -71,15 +71,9 @@ struct _Py_unicode_state { PyObject *latin1[256]; struct _Py_unicode_fs_codec fs_codec; - /* This dictionary holds all interned unicode strings. Note that references - to strings in this dictionary are *not* counted in the string's ob_refcnt. - When the interned string reaches a refcnt of 0 the string deallocation - function will delete the reference from this dictionary. - - Another way to look at this is that to say that the actual reference - count of a string is: s->ob_refcnt + (s->state ? 2 : 0) - */ - PyObject *interned; + // Unused member kept for ABI backward compatibility with Python 3.10.0: + // see bpo-46006. + PyObject *unused_interned; // Unicode identifiers (_Py_Identifier): see _PyUnicode_FromId() struct _Py_unicode_ids ids; |