summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-03-21 17:46:09 (GMT)
committerGitHub <noreply@github.com>2023-03-21 17:46:09 (GMT)
commit743687434c5baf01c266320b34c7a828726702a6 (patch)
tree6d26f4fcb5aaa2b606b433aecad939e9f36734f9 /Python/sysmodule.c
parent4bb1dd3c5c14338c9d9cea5988431c858b3b76e0 (diff)
downloadcpython-743687434c5baf01c266320b34c7a828726702a6.zip
cpython-743687434c5baf01c266320b34c7a828726702a6.tar.gz
cpython-743687434c5baf01c266320b34c7a828726702a6.tar.bz2
gh-102304: Move the Total Refcount to PyInterpreterState (gh-102545)
Moving it valuable with a per-interpreter GIL. However, it is also useful without one, since it allows us to identify refleaks within a single interpreter or where references are escaping an interpreter. This becomes more important as we move the obmalloc state to PyInterpreterState. https://github.com/python/cpython/issues/102304
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 2076173..4afb0f1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1854,6 +1854,8 @@ static Py_ssize_t
sys_gettotalrefcount_impl(PyObject *module)
/*[clinic end generated code: output=4103886cf17c25bc input=53b744faa5d2e4f6]*/
{
+ /* It may make sense to return the total for the current interpreter
+ or have a second function that does so. */
return _Py_GetGlobalRefTotal();
}