diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-03-20 16:03:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-20 16:03:04 (GMT) |
commit | ad77d16a6252c2e616bf41b981a6d919c1122b4d (patch) | |
tree | 17a73242035ac8da8c0096effe17d665cdfe843b /Include/object.h | |
parent | 96e05b62e827a6dee6c658fea9b4976dfd8d30e3 (diff) | |
download | cpython-ad77d16a6252c2e616bf41b981a6d919c1122b4d.zip cpython-ad77d16a6252c2e616bf41b981a6d919c1122b4d.tar.gz cpython-ad77d16a6252c2e616bf41b981a6d919c1122b4d.tar.bz2 |
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
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Include/object.h b/Include/object.h index 844b9c4..fc57735 100644 --- a/Include/object.h +++ b/Include/object.h @@ -494,14 +494,9 @@ you can count such references to the type object.) extern Py_ssize_t _Py_RefTotal; # define _Py_INC_REFTOTAL() _Py_RefTotal++ # define _Py_DEC_REFTOTAL() _Py_RefTotal-- -# elif defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -extern void _Py_IncRefTotal(void); -extern void _Py_DecRefTotal(void); -# define _Py_INC_REFTOTAL() _Py_IncRefTotal() -# define _Py_DEC_REFTOTAL() _Py_DecRefTotal() # elif !defined(Py_LIMITED_API) || Py_LIMITED_API+0 > 0x030C0000 -extern void _Py_IncRefTotal_DO_NOT_USE_THIS(void); -extern void _Py_DecRefTotal_DO_NOT_USE_THIS(void); +PyAPI_FUNC(void) _Py_IncRefTotal_DO_NOT_USE_THIS(void); +PyAPI_FUNC(void) _Py_DecRefTotal_DO_NOT_USE_THIS(void); # define _Py_INC_REFTOTAL() _Py_IncRefTotal_DO_NOT_USE_THIS() # define _Py_DEC_REFTOTAL() _Py_DecRefTotal_DO_NOT_USE_THIS() # endif |