diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-11-11 21:24:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 21:24:18 (GMT) |
commit | f531b6879b530515b009ac79767702829848cf07 (patch) | |
tree | bf2fbc70bc62929ec8d8806acd284340d9a1b173 /Include/internal/pycore_runtime_init.h | |
parent | dd36b71fa6164ebba5d94bb4a24eac43b1c54906 (diff) | |
download | cpython-f531b6879b530515b009ac79767702829848cf07.zip cpython-f531b6879b530515b009ac79767702829848cf07.tar.gz cpython-f531b6879b530515b009ac79767702829848cf07.tar.bz2 |
gh-81057: Add PyInterpreterState.static_objects (gh-99397)
As we consolidate global variables, we find some objects that are almost suitable to add to _PyRuntimeState.global_objects, but have some small/sneaky bit of per-interpreter state (e.g. a weakref list). We're adding PyInterpreterState.static_objects so we can move such objects there. (We'll removed the _not_used field once we've added others.)
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Include/internal/pycore_runtime_init.h')
-rw-r--r-- | Include/internal/pycore_runtime_init.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h index 4e8dd7b..41a7730 100644 --- a/Include/internal/pycore_runtime_init.h +++ b/Include/internal/pycore_runtime_init.h @@ -77,6 +77,11 @@ extern "C" { { .threshold = 10, }, \ }, \ }, \ + .static_objects = { \ + .singletons = { \ + ._not_used = 1, \ + }, \ + }, \ ._initial_thread = _PyThreadState_INIT, \ } |