gh-102304: Move _Py_RefTotal to _PyRuntimeState (gh-102543)

The essentially eliminates the global variable, with the associated benefits. This is also a precursor to isolating this bit of state to PyInterpreterState.

Folks that currently read _Py_RefTotal directly would have to start using _Py_GetGlobalRefTotal() instead.

https://github.com/python/cpython/issues/102304
This commit is contained in:
Eric Snow 2023-03-20 10:03:04 -06:00 committed by GitHub
parent 96e05b62e8
commit ad77d16a62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 132 additions and 47 deletions

View file

@ -1930,6 +1930,7 @@ Py_FinalizeEx(void)
if (show_ref_count) {
_PyDebug_PrintTotalRefs();
}
_Py_FinalizeRefTotal(runtime);
#endif
#ifdef Py_TRACE_REFS