Skip to content

Commit 13a97f3

Browse files
committed
Omit immortal and live objects
1 parent 8f4ce45 commit 13a97f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/gc_free_threading.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,6 @@ update_refs(const mi_heap_t *heap, const mi_heap_area_t *area,
977977
void *block, size_t block_size, void *args)
978978
{
979979
struct collection_state *state = (struct collection_state *)args;
980-
state->visited++;
981980
PyObject *op = op_from_block(block, &state->base, false);
982981
if (op == NULL) {
983982
return true;
@@ -994,6 +993,7 @@ update_refs(const mi_heap_t *heap, const mi_heap_area_t *area,
994993
gc_clear_unreachable(op);
995994
return true;
996995
}
996+
state->visited++;
997997

998998
Py_ssize_t refcount = Py_REFCNT(op);
999999
if (_PyObject_HasDeferredRefcount(op)) {

0 commit comments

Comments
 (0)