mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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:
parent
96e05b62e8
commit
ad77d16a62
13 changed files with 132 additions and 47 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue