* move _PyRuntime.global_objects.interned to _PyRuntime.cached_objects.interned_strings (and use _Py_CACHED_OBJECT())
* rename _PyRuntime.global_objects to _PyRuntime.static_objects
(This also relates to gh-96075.)
https://github.com/python/cpython/issues/90111
struct _Py_cached_objects {
PyObject *str_replace_inf;
+
+ PyObject *interned_strings;
};
#define _Py_GLOBAL_OBJECT(NAME) \
- _PyRuntime.global_objects.NAME
+ _PyRuntime.static_objects.NAME
#define _Py_SINGLETON(NAME) \
_Py_GLOBAL_OBJECT(singletons.NAME)
-struct _Py_global_objects {
+struct _Py_static_objects {
struct {
/* Small integers are preallocated in this array so that they
* can be shared.
PyHamtNode_Bitmap hamt_bitmap_node_empty;
_PyContextTokenMissing context_token_missing;
} singletons;
-
- PyObject *interned;
};
#define _Py_INTERP_CACHED_OBJECT(interp, NAME) \
/* All the objects that are shared by the runtime's interpreters. */
struct _Py_cached_objects cached_objects;
- struct _Py_global_objects global_objects;
+ struct _Py_static_objects static_objects;
/* The following fields are here to avoid allocation during init.
The data is exposed through _PyRuntimeState pointer fields.
.types = { \
.next_version_tag = 1, \
}, \
- .global_objects = { \
+ .static_objects = { \
.singletons = { \
.small_ints = _Py_small_ints_INIT, \
.bytes_empty = _PyBytes_SIMPLE_INIT(0, 0), \
*/
static inline PyObject *get_interned_dict(void)
{
- return _PyRuntime.global_objects.interned;
+ return _Py_CACHED_OBJECT(interned_strings);
}
static inline void set_interned_dict(PyObject *dict)
{
- _PyRuntime.global_objects.interned = dict;
+ _Py_CACHED_OBJECT(interned_strings) = dict;
}
#define _Py_RETURN_UNICODE_EMPTY() \