summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-11-15 09:45:11 -0700
committerGitHub <noreply@github.com>2022-11-15 09:45:11 -0700
commit3c57971a2d3b6d2c6fd1f525ba2108fccb35add2 (patch)
tree697c28707c62e43c9a444af3069304b8fad2e54b /Objects
parent73943cbc4c5e97f71b76150c549d07e8ed00066b (diff)
downloadcpython-git-3c57971a2d3b6d2c6fd1f525ba2108fccb35add2.tar.gz
gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)
This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c2
-rw-r--r--Objects/obmalloc.c6
2 files changed, 1 insertions, 7 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 01eede94d5..a499cb32b2 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2001,7 +2001,7 @@ _PyTypes_FiniTypes(PyInterpreterState *interp)
void
_Py_NewReference(PyObject *op)
{
- if (_Py_tracemalloc_config.tracing) {
+ if (_PyRuntime.tracemalloc.config.tracing) {
_PyTraceMalloc_NewReference(op);
}
#ifdef Py_REF_DEBUG
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 481cbde9fd..4c08bc214c 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -201,12 +201,6 @@ _PyMem_ArenaFree(void *Py_UNUSED(ctx), void *ptr,
#endif
-/* bpo-35053: Declare tracemalloc configuration here rather than
- Modules/_tracemalloc.c because _tracemalloc can be compiled as dynamic
- library, whereas _Py_NewReference() requires it. */
-struct _PyTraceMalloc_Config _Py_tracemalloc_config = _PyTraceMalloc_Config_INIT;
-
-
#define _PyMem_Raw (_PyRuntime.allocators.standard.raw)
#define _PyMem (_PyRuntime.allocators.standard.mem)
#define _PyObject (_PyRuntime.allocators.standard.obj)