Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-81057: Move Globals in Core Code to _PyRuntimeState #99496

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move effectively-const globals initialized during init.
  • Loading branch information
ericsnowcurrently committed Nov 14, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit f45f96039530144bc6904a3dc3fa127ac65c792a
30 changes: 2 additions & 28 deletions Tools/c-analyzer/cpython/globals-to-fix.tsv
Original file line number Diff line number Diff line change
@@ -311,34 +311,8 @@ Python/hamt.c - _empty_hamt -
# global non-objects to fix in core code

#-----------------------
# initialized/set once

# during init
Objects/unicodeobject.c - bloom_linebreak -
Python/bootstrap_hash.c - _Py_HashSecret_Initialized -
Python/bootstrap_hash.c py_getrandom getrandom_works -
Python/initconfig.c - _Py_global_config_int_max_str_digits -
Python/initconfig.c - orig_argv -
Python/pyhash.c - _Py_HashSecret -
Python/pylifecycle.c - runtime_initialized -
Python/sysmodule.c - _PySys_ImplCacheTag -
Python/sysmodule.c - _PySys_ImplName -
Python/sysmodule.c - _preinit_warnoptions -
Python/sysmodule.c - _preinit_xoptions -
Python/thread.c - initialized -
Python/thread_pthread.h - condattr_monotonic -
Python/thread_pthread.h init_condattr ca -

# set by embedders during init
Python/initconfig.c - _Py_StandardStreamEncoding -
Python/initconfig.c - _Py_StandardStreamErrors -

# lazy
Objects/floatobject.c - double_format -
Objects/floatobject.c - float_format -
Objects/longobject.c long_from_non_binary_base log_base_BASE -
Objects/longobject.c long_from_non_binary_base convwidth_base -
Objects/longobject.c long_from_non_binary_base convmultmax_base -
# effectively-const but initialized lazily

Python/perf_trampoline.c - perf_map_file -
Objects/unicodeobject.c - ucnhash_capi -
Parser/action_helpers.c _PyPegen_dummy_name cache -
31 changes: 31 additions & 0 deletions Tools/c-analyzer/cpython/ignored.tsv
Original file line number Diff line number Diff line change
@@ -32,6 +32,35 @@ Python/initconfig.c - Py_IsolatedFlag -
Python/initconfig.c - Py_LegacyWindowsFSEncodingFlag -
Python/initconfig.c - Py_LegacyWindowsStdioFlag -

#-----------------------
# effectively const, initialized during init

Objects/floatobject.c - double_format -
Objects/floatobject.c - float_format -
Objects/unicodeobject.c - bloom_linebreak -
Python/bootstrap_hash.c py_getrandom getrandom_works -
Python/bootstrap_hash.c - _Py_HashSecret_Initialized -
Python/initconfig.c - orig_argv -
Python/pyhash.c - _Py_HashSecret -
Python/pylifecycle.c - runtime_initialized -
Python/sysmodule.c - _preinit_warnoptions -
Python/sysmodule.c - _preinit_xoptions -
Python/thread.c - initialized -
Python/thread_pthread.h - condattr_monotonic -
Python/thread_pthread.h init_condattr ca -

# set by embedders during init
Python/initconfig.c - _Py_StandardStreamEncoding -
Python/initconfig.c - _Py_StandardStreamErrors -

#-----------------------
# effectively const but initialized lazily

# idempotent
Objects/longobject.c long_from_non_binary_base log_base_BASE -
Objects/longobject.c long_from_non_binary_base convwidth_base -
Objects/longobject.c long_from_non_binary_base convmultmax_base -

#-----------------------
# others

@@ -537,4 +566,6 @@ Python/specialize.c - adaptive_opcodes -
Python/specialize.c - cache_requirements -
Python/specialize.c - compare_masks -
Python/stdlib_module_names.h - _Py_stdlib_module_names -
Python/sysmodule.c - _PySys_ImplCacheTag -
Python/sysmodule.c - _PySys_ImplName -
Python/sysmodule.c - whatstrings -