summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_interp.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_interp.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_interp.h')
-rw-r--r--Include/internal/pycore_interp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h
index 068b0a7..976e16a 100644
--- a/Include/internal/pycore_interp.h
+++ b/Include/internal/pycore_interp.h
@@ -20,6 +20,7 @@ extern "C" {
#include "pycore_genobject.h" // struct _Py_async_gen_state
#include "pycore_gc.h" // struct _gc_runtime_state
#include "pycore_list.h" // struct _Py_list_state
+#include "pycore_global_objects.h" // struct _Py_interp_static_objects
#include "pycore_tuple.h" // struct _Py_tuple_state
#include "pycore_typeobject.h" // struct type_cache
#include "pycore_unicodeobject.h" // struct _Py_unicode_state
@@ -207,6 +208,9 @@ struct _is {
struct callable_cache callable_cache;
PyCodeObject *interpreter_trampoline;
+ struct _Py_interp_cached_objects cached_objects;
+ struct _Py_interp_static_objects static_objects;
+
/* The following fields are here to avoid allocation during init.
The data is exposed through PyInterpreterState pointer fields.
These fields should not be accessed directly outside of init.