gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)

This moves nearly all remaining object-holding globals in core code (other than static types).

https://github.com/python/cpython/issues/81057
This commit is contained in:
Eric Snow 2022-11-14 13:50:56 -07:00 committed by GitHub
parent 619cadcda6
commit a088290f9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 66 additions and 55 deletions

View file

@ -298,15 +298,6 @@ Objects/setobject.c - _dummy_struct -
Objects/setobject.c - _PySet_Dummy -
Objects/sliceobject.c - _Py_EllipsisObject -
#-----------------------
# cached - initialized once
# manually cached PyUnicodeObject
Python/ast_unparse.c - _str_replace_inf -
# other
Objects/typeobject.c object___reduce_ex___impl objreduce -
#-----------------------
# other
@ -315,9 +306,6 @@ Python/context.c - _token_missing -
Python/hamt.c - _empty_bitmap_node -
Python/hamt.c - _empty_hamt -
# state
Objects/typeobject.c resolve_slotdups pname -
##################################
# global non-objects to fix in core code
@ -438,8 +426,6 @@ Python/perf_trampoline.c - perf_status -
Python/perf_trampoline.c - extra_code_index -
Python/perf_trampoline.c - code_arena -
Python/perf_trampoline.c - trampoline_api -
Objects/typeobject.c - next_version_tag -
Objects/typeobject.c resolve_slotdups ptrs -
Parser/pegen.c - memo_statistics -
Python/bootstrap_hash.c - urandom_cache -
Python/ceval_gil.c make_pending_calls busy -
@ -513,27 +499,12 @@ Modules/itertoolsmodule.c - ziplongest_type -
#-----------------------
# other
# statically initializd pointer to static type
# XXX should be const?
Modules/_io/winconsoleio.c - _PyWindowsConsoleIO_Type -
# initialized once
Modules/_functoolsmodule.c - kwd_mark -
Modules/_io/_iomodule.c - _PyIO_empty_bytes -
Modules/_testcapi/heaptype.c - _testcapimodule -
Modules/_testcapi/unicode.c - _testcapimodule -
Modules/_tracemalloc.c - tracemalloc_empty_traceback -
Modules/signalmodule.c - DefaultHandler -
Modules/signalmodule.c - IgnoreHandler -
Modules/signalmodule.c - IntHandler -
# state
Modules/faulthandler.c - fatal_error -
Modules/faulthandler.c - thread -
Modules/faulthandler.c - user_signals -
Modules/faulthandler.c - stack -
Modules/faulthandler.c - old_stack -
Modules/signalmodule.c - Handlers -
##################################
@ -554,6 +525,7 @@ Modules/timemodule.c _PyTime_GetProcessTimeWithInfo ticks_per_second -
Modules/_tracemalloc.c - allocators -
Modules/_tracemalloc.c - tables_lock -
Modules/_tracemalloc.c - tracemalloc_empty_traceback -
Modules/_tracemalloc.c - tracemalloc_traced_memory -
Modules/_tracemalloc.c - tracemalloc_peak_traced_memory -
Modules/_tracemalloc.c - tracemalloc_filenames -
@ -567,6 +539,7 @@ Modules/posixmodule.c - environ -
Modules/signalmodule.c - is_tripped -
Modules/signalmodule.c - signal_global_state -
Modules/signalmodule.c - wakeup -
Modules/signalmodule.c - Handlers -
##################################

Can't render this file because it has a wrong number of fields in line 4.

View file

@ -181,6 +181,8 @@ Modules/_testbuffer.c ndarray_memoryview_from_buffer strides -
Modules/_testbuffer.c ndarray_memoryview_from_buffer suboffsets -
Modules/_testbuffer.c ndarray_push kwlist -
Modules/_testbuffer.c staticarray_init kwlist -
Modules/_testcapi/heaptype.c - _testcapimodule -
Modules/_testcapi/unicode.c - _testcapimodule -
Modules/_testcapimodule.c - ContainerNoGC_members -
Modules/_testcapimodule.c - ContainerNoGC_type -
Modules/_testcapimodule.c - FmData -
@ -379,6 +381,7 @@ Modules/_decimal/_decimal.c - ssize_constants -
Modules/_elementtree.c - ExpatMemoryHandler -
Modules/_io/_iomodule.c - static_types -
Modules/_io/textio.c - encodefuncs -
Modules/_io/winconsoleio.c - _PyWindowsConsoleIO_Type -
Modules/_localemodule.c - langinfo_constants -
Modules/_pickle.c - READ_WHOLE_LINE -
Modules/_sqlite/module.c - error_codes -

Can't render this file because it has a wrong number of fields in line 4.