Skip to content

Commit

Permalink
Merge branch 'python:main' into pythongh-102765
Browse files Browse the repository at this point in the history
  • Loading branch information
finnagin authored Mar 28, 2023
2 parents 0d373d1 + ba65a06 commit 82cab87
Show file tree
Hide file tree
Showing 21 changed files with 837 additions and 936 deletions.
13 changes: 2 additions & 11 deletions Include/internal/pycore_global_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ extern "C" {
// Only immutable objects should be considered runtime-global.
// All others must be per-interpreter.

#define _Py_CACHED_OBJECT(NAME) \
_PyRuntime.cached_objects.NAME

struct _Py_cached_objects {
PyObject *interned_strings;
/* A thread state tied to the main interpreter,
used exclusively for when a global object (e.g. interned strings)
is resized (i.e. deallocated + allocated) from an arbitrary thread. */
PyThreadState main_tstate;
};

#define _Py_GLOBAL_OBJECT(NAME) \
_PyRuntime.static_objects.NAME
#define _Py_SINGLETON(NAME) \
Expand Down Expand Up @@ -69,6 +58,8 @@ struct _Py_static_objects {
(interp)->cached_objects.NAME

struct _Py_interp_cached_objects {
PyObject *interned_strings;

/* AST */
PyObject *str_replace_inf;

Expand Down
5 changes: 0 additions & 5 deletions Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ PyAPI_FUNC(void) _PyThreadState_Init(
PyThreadState *tstate);
PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate);

extern void _PyThreadState_InitDetached(PyThreadState *, PyInterpreterState *);
extern void _PyThreadState_ClearDetached(PyThreadState *);

extern PyObject * _Py_AddToGlobalDict(PyObject *, PyObject *, PyObject *);


static inline void
_PyThreadState_UpdateTracingState(PyThreadState *tstate)
Expand Down
1 change: 0 additions & 1 deletion Include/internal/pycore_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ typedef struct pyruntimestate {
} types;

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

/* The following fields are here to avoid allocation during init.
Expand Down
3 changes: 0 additions & 3 deletions Include/internal/pycore_runtime_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ extern PyTypeObject _PyExc_MemoryError;
.types = { \
.next_version_tag = 1, \
}, \
.cached_objects = { \
.main_tstate = _PyThreadState_INIT, \
}, \
.static_objects = { \
.singletons = { \
.small_ints = _Py_small_ints_INIT, \
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct _Py_unicode_runtime_ids {

struct _Py_unicode_runtime_state {
struct _Py_unicode_runtime_ids ids;
/* The interned dict is at _PyRuntime.cached_objects.interned_strings. */
};

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

extern void _PyUnicode_InternInPlace(PyInterpreterState *interp, PyObject **p);
extern void _PyUnicode_ClearInterned(PyInterpreterState *interp);


Expand Down
Loading

0 comments on commit 82cab87

Please sign in to comment.