summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_runtime_init.h
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-11-11 21:24:18 (GMT)
committerGitHub <noreply@github.com>2022-11-11 21:24:18 (GMT)
commitf531b6879b530515b009ac79767702829848cf07 (patch)
treebf2fbc70bc62929ec8d8806acd284340d9a1b173 /Include/internal/pycore_runtime_init.h
parentdd36b71fa6164ebba5d94bb4a24eac43b1c54906 (diff)
downloadcpython-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.h5
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, \
}