From 01fa907aa8e7c475a76b407f35c635b26c9f47f8 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 16 Nov 2022 09:54:28 -0700 Subject: gh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400) This is part of the effort to consolidate global variables, to make them easier to manage (and make it easier to later move some of them to PyInterpreterState). https://github.com/python/cpython/issues/81057 --- Include/internal/pycore_global_objects.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Include/internal/pycore_global_objects.h') diff --git a/Include/internal/pycore_global_objects.h b/Include/internal/pycore_global_objects.h index 5ad1f7d217..80f6bb2c8a 100644 --- a/Include/internal/pycore_global_objects.h +++ b/Include/internal/pycore_global_objects.h @@ -10,6 +10,8 @@ extern "C" { #include "pycore_gc.h" // PyGC_Head #include "pycore_global_strings.h" // struct _Py_global_strings +#include "pycore_hamt.h" // PyHamtNode_Bitmap +#include "pycore_context.h" // _PyContextTokenMissing #include "pycore_typeobject.h" // pytype_slotdef @@ -52,6 +54,10 @@ struct _Py_global_objects { _PyGC_Head_UNUSED _tuple_empty_gc_not_used; PyTupleObject tuple_empty; + + _PyGC_Head_UNUSED _hamt_bitmap_node_empty_gc_not_used; + PyHamtNode_Bitmap hamt_bitmap_node_empty; + _PyContextTokenMissing context_token_missing; } singletons; PyObject *interned; @@ -76,6 +82,9 @@ struct _Py_interp_cached_objects { struct _Py_interp_static_objects { struct { int _not_used; + // hamt_empty is here instead of global because of its weakreflist. + _PyGC_Head_UNUSED _hamt_empty_gc_not_used; + PyHamtObject hamt_empty; } singletons; }; -- cgit v1.2.1