Skip to content

Commit 82cab87

Browse files
authored
Merge branch 'python:main' into pythongh-102765
2 parents 0d373d1 + ba65a06 commit 82cab87

21 files changed

Lines changed: 837 additions & 936 deletions

‎Include/internal/pycore_global_objects.h‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ extern "C" {
2323
// Only immutable objects should be considered runtime-global.
2424
// All others must be per-interpreter.
2525

26-
#define _Py_CACHED_OBJECT(NAME) \
27-
_PyRuntime.cached_objects.NAME
28-
29-
struct _Py_cached_objects {
30-
PyObject *interned_strings;
31-
/* A thread state tied to the main interpreter,
32-
used exclusively for when a global object (e.g. interned strings)
33-
is resized (i.e. deallocated + allocated) from an arbitrary thread. */
34-
PyThreadState main_tstate;
35-
};
36-
3726
#define _Py_GLOBAL_OBJECT(NAME) \
3827
_PyRuntime.static_objects.NAME
3928
#define _Py_SINGLETON(NAME) \
@@ -69,6 +58,8 @@ struct _Py_static_objects {
6958
(interp)->cached_objects.NAME
7059

7160
struct _Py_interp_cached_objects {
61+
PyObject *interned_strings;
62+
7263
/* AST */
7364
PyObject *str_replace_inf;
7465

‎Include/internal/pycore_pystate.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ PyAPI_FUNC(void) _PyThreadState_Init(
127127
PyThreadState *tstate);
128128
PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate);
129129

130-
extern void _PyThreadState_InitDetached(PyThreadState *, PyInterpreterState *);
131-
extern void _PyThreadState_ClearDetached(PyThreadState *);
132-
133-
extern PyObject * _Py_AddToGlobalDict(PyObject *, PyObject *, PyObject *);
134-
135130

136131
static inline void
137132
_PyThreadState_UpdateTracingState(PyThreadState *tstate)

‎Include/internal/pycore_runtime.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ typedef struct pyruntimestate {
163163
} types;
164164

165165
/* All the objects that are shared by the runtime's interpreters. */
166-
struct _Py_cached_objects cached_objects;
167166
struct _Py_static_objects static_objects;
168167

169168
/* The following fields are here to avoid allocation during init.

‎Include/internal/pycore_runtime_init.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ extern PyTypeObject _PyExc_MemoryError;
5959
.types = { \
6060
.next_version_tag = 1, \
6161
}, \
62-
.cached_objects = { \
63-
.main_tstate = _PyThreadState_INIT, \
64-
}, \
6562
.static_objects = { \
6663
.singletons = { \
6764
.small_ints = _Py_small_ints_INIT, \

‎Include/internal/pycore_unicodeobject.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ struct _Py_unicode_runtime_ids {
3434

3535
struct _Py_unicode_runtime_state {
3636
struct _Py_unicode_runtime_ids ids;
37-
/* The interned dict is at _PyRuntime.cached_objects.interned_strings. */
3837
};
3938

4039
/* fs_codec.encoding is initialized to NULL.
@@ -60,6 +59,7 @@ struct _Py_unicode_state {
6059
struct _Py_unicode_ids ids;
6160
};
6261

62+
extern void _PyUnicode_InternInPlace(PyInterpreterState *interp, PyObject **p);
6363
extern void _PyUnicode_ClearInterned(PyInterpreterState *interp);
6464

6565

0 commit comments

Comments
 (0)