Skip to content

Commit ad7e962

Browse files
Drop _PyRuntime.object_state.last_legacy_reftotal.
1 parent effb0d1 commit ad7e962

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

Include/internal/pycore_object_state.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
struct _py_object_runtime_state {
12-
#ifdef Py_REF_DEBUG
13-
Py_ssize_t last_legacy_reftotal;
14-
#else
15-
int _not_used;
16-
#endif
17-
};
18-
1911
struct _py_object_state {
2012
#ifdef Py_REF_DEBUG
2113
Py_ssize_t reftotal;

Include/internal/pycore_runtime.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ extern "C" {
1616
#include "pycore_global_objects.h" // struct _Py_global_objects
1717
#include "pycore_import.h" // struct _import_runtime_state
1818
#include "pycore_interp.h" // PyInterpreterState
19-
#include "pycore_object_state.h" // struct _py_object_runtime_state
2019
#include "pycore_parser.h" // struct _parser_runtime_state
2120
#include "pycore_pymem.h" // struct _pymem_allocators
2221
#include "pycore_pyhash.h" // struct pyhash_runtime_state
@@ -152,7 +151,6 @@ typedef struct pyruntimestate {
152151
void *open_code_userdata;
153152
_Py_AuditHookEntry *audit_hook_head;
154153

155-
struct _py_object_runtime_state object_state;
156154
struct _Py_float_runtime_state float_state;
157155
struct _Py_unicode_runtime_state unicode_state;
158156
struct _Py_dict_runtime_state dict_state;

Objects/object.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ get_global_reftotal(void)
109109
HEAD_UNLOCK(&_PyRuntime);
110110

111111
/* Add in the updated value from the legacy _Py_RefTotal. */
112-
Py_ssize_t last = _PyRuntime.object_state.last_legacy_reftotal;
113-
Py_ssize_t legacy = get_legacy_reftotal();
114-
_PyRuntime.object_state.last_legacy_reftotal = legacy;
115-
total += legacy;
112+
total += get_legacy_reftotal();
116113

117114
return total;
118115
}

0 commit comments

Comments
 (0)