diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-03-28 18:52:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 18:52:28 (GMT) |
commit | ba65a065cf07a7a9f53be61057a090f7311a5ad7 (patch) | |
tree | 279e23bf7b8b1cfbf9a1a976a086ca129bbbe5cf /Tools/build/generate_global_objects.py | |
parent | 7703def37e4fa7d25c3d23756de8f527daa4e165 (diff) | |
download | cpython-ba65a065cf07a7a9f53be61057a090f7311a5ad7.zip cpython-ba65a065cf07a7a9f53be61057a090f7311a5ad7.tar.gz cpython-ba65a065cf07a7a9f53be61057a090f7311a5ad7.tar.bz2 |
gh-100227: Move the Dict of Interned Strings to PyInterpreterState (gh-102339)
We can revisit the options for keeping it global later, if desired. For now the approach seems quite complex, so we've gone with the simpler isolation solution in the meantime.
https://github.com/python/cpython/issues/100227
Diffstat (limited to 'Tools/build/generate_global_objects.py')
-rw-r--r-- | Tools/build/generate_global_objects.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/build/generate_global_objects.py b/Tools/build/generate_global_objects.py index 1f53f02..c278177 100644 --- a/Tools/build/generate_global_objects.py +++ b/Tools/build/generate_global_objects.py @@ -354,14 +354,14 @@ def generate_static_strings_initializer(identifiers, strings): printer.write(before) printer.write(START) printer.write("static inline void") - with printer.block("_PyUnicode_InitStaticStrings(void)"): + with printer.block("_PyUnicode_InitStaticStrings(PyInterpreterState *interp)"): printer.write(f'PyObject *string;') for i in sorted(identifiers): # This use of _Py_ID() is ignored by iter_global_strings() # since iter_files() ignores .h files. printer.write(f'string = &_Py_ID({i});') printer.write(f'assert(_PyUnicode_CheckConsistency(string, 1));') - printer.write(f'PyUnicode_InternInPlace(&string);') + printer.write(f'_PyUnicode_InternInPlace(interp, &string);') # XXX What about "strings"? printer.write(END) printer.write(after) |