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/internal/pycore_object_state.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/internal/pycore_object_state.h')
-rw-r--r-- | Include/internal/pycore_object_state.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Include/internal/pycore_object_state.h b/Include/internal/pycore_object_state.h new file mode 100644 index 0000000..4e5862a --- /dev/null +++ b/Include/internal/pycore_object_state.h @@ -0,0 +1,23 @@ +#ifndef Py_INTERNAL_OBJECT_STATE_H +#define Py_INTERNAL_OBJECT_STATE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct _py_object_runtime_state { +#ifdef Py_REF_DEBUG + Py_ssize_t reftotal; +#else + int _not_used; +#endif +}; + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_OBJECT_STATE_H */ |