diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-09-03 06:43:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-03 06:43:08 (GMT) |
commit | 6dab8c95bd8db18e09619d804a938ab3e46042fc (patch) | |
tree | 5e4ade21c974782385aa48f945a66701b895e3c3 /Objects/unicodeobject.c | |
parent | 16c6759b3748f9b787b2fa4d5e652a8e08a17dee (diff) | |
download | cpython-6dab8c95bd8db18e09619d804a938ab3e46042fc.zip cpython-6dab8c95bd8db18e09619d804a938ab3e46042fc.tar.gz cpython-6dab8c95bd8db18e09619d804a938ab3e46042fc.tar.bz2 |
GH-96458: Statically initialize utf8 representation of static strings (#96481)
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 13f2c5b..bd169ed 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -15184,23 +15184,6 @@ _PyUnicode_FiniTypes(PyInterpreterState *interp) } -static void unicode_static_dealloc(PyObject *op) -{ - PyASCIIObject *ascii = _PyASCIIObject_CAST(op); - - assert(ascii->state.compact); - - if (!ascii->state.ascii) { - PyCompactUnicodeObject* compact = (PyCompactUnicodeObject*)op; - if (compact->utf8) { - PyObject_Free(compact->utf8); - compact->utf8 = NULL; - compact->utf8_length = 0; - } - } -} - - void _PyUnicode_Fini(PyInterpreterState *interp) { @@ -15217,24 +15200,8 @@ _PyUnicode_Fini(PyInterpreterState *interp) _PyUnicode_FiniEncodings(&state->fs_codec); unicode_clear_identifiers(state); - - // Clear the single character singletons - for (int i = 0; i < 128; i++) { - unicode_static_dealloc((PyObject*)&_Py_SINGLETON(strings).ascii[i]); - } - for (int i = 0; i < 128; i++) { - unicode_static_dealloc((PyObject*)&_Py_SINGLETON(strings).latin1[i]); - } } - -void -_PyStaticUnicode_Dealloc(PyObject *op) -{ - unicode_static_dealloc(op); -} - - /* A _string module, to export formatter_parser and formatter_field_name_split to the string.Formatter class implemented in Python. */ |