summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-08-05 11:44:54 (GMT)
committerGitHub <noreply@github.com>2023-08-05 11:44:54 (GMT)
commit6e4eec760648a71e1cd8f8f551997b1823b4bb9f (patch)
treef4c85ea58ca843fa29a289b2e5737b491a7e7aa2 /Include
parent0e7a4f733685e7a7ccf28d850bae1b2222977362 (diff)
downloadcpython-6e4eec760648a71e1cd8f8f551997b1823b4bb9f.zip
cpython-6e4eec760648a71e1cd8f8f551997b1823b4bb9f.tar.gz
cpython-6e4eec760648a71e1cd8f8f551997b1823b4bb9f.tar.bz2
[3.12] gh-107630: Revert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)" (#107648)
Revert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)" This reverts commit 58af2293c52a1ad3754d254690c0e54f787c545b.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_object.h4
-rw-r--r--Include/internal/pycore_object_state.h13
-rw-r--r--Include/internal/pycore_runtime_init.h11
3 files changed, 6 insertions, 22 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h
index 5a94034..0981d11 100644
--- a/Include/internal/pycore_object.h
+++ b/Include/internal/pycore_object.h
@@ -271,8 +271,8 @@ extern void _PyDebug_PrintTotalRefs(void);
#ifdef Py_TRACE_REFS
extern void _Py_AddToAllObjects(PyObject *op, int force);
-extern void _Py_PrintReferences(PyInterpreterState *, FILE *);
-extern void _Py_PrintReferenceAddresses(PyInterpreterState *, FILE *);
+extern void _Py_PrintReferences(FILE *);
+extern void _Py_PrintReferenceAddresses(FILE *);
#endif
diff --git a/Include/internal/pycore_object_state.h b/Include/internal/pycore_object_state.h
index 65feb5a..94005d7 100644
--- a/Include/internal/pycore_object_state.h
+++ b/Include/internal/pycore_object_state.h
@@ -11,22 +11,17 @@ extern "C" {
struct _py_object_runtime_state {
#ifdef Py_REF_DEBUG
Py_ssize_t interpreter_leaks;
-#endif
+#else
int _not_used;
+#endif
};
struct _py_object_state {
#ifdef Py_REF_DEBUG
Py_ssize_t reftotal;
-#endif
-#ifdef Py_TRACE_REFS
- /* Head of circular doubly-linked list of all objects. These are linked
- * together via the _ob_prev and _ob_next members of a PyObject, which
- * exist only in a Py_TRACE_REFS build.
- */
- PyObject refchain;
-#endif
+#else
int _not_used;
+#endif
};
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h
index 7aace9f..4130188 100644
--- a/Include/internal/pycore_runtime_init.h
+++ b/Include/internal/pycore_runtime_init.h
@@ -101,7 +101,6 @@ extern PyTypeObject _PyExc_MemoryError;
{ .threshold = 10, }, \
}, \
}, \
- .object_state = _py_object_state_INIT(INTERP), \
.dtoa = _dtoa_state_INIT(&(INTERP)), \
.dict_state = _dict_state_INIT, \
.func_state = { \
@@ -131,16 +130,6 @@ extern PyTypeObject _PyExc_MemoryError;
.context_ver = 1, \
}
-#ifdef Py_TRACE_REFS
-# define _py_object_state_INIT(INTERP) \
- { \
- .refchain = {&INTERP.object_state.refchain, &INTERP.object_state.refchain}, \
- }
-#else
-# define _py_object_state_INIT(INTERP) \
- { 0 }
-#endif
-
// global objects