Revert "GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-126502)" (#126983)

This commit is contained in:
Hugo van Kemenade 2024-11-19 11:25:09 +02:00 committed by GitHub
parent 84f07c3a4c
commit 899fdb213d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 331 additions and 333 deletions

View file

@ -3,7 +3,7 @@
#include "pycore_brc.h" // struct _brc_thread_state
#include "pycore_ceval.h" // _Py_set_eval_breaker_bit()
#include "pycore_context.h"
#include "pycore_dict.h" // _PyInlineValuesSize()
#include "pycore_dict.h" // _PyDict_MaybeUntrack()
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
#include "pycore_initconfig.h"
#include "pycore_interp.h" // PyInterpreterState.gc
@ -493,6 +493,13 @@ update_refs(const mi_heap_t *heap, const mi_heap_area_t *area,
return true;
}
}
else if (PyDict_CheckExact(op)) {
_PyDict_MaybeUntrack(op);
if (!_PyObject_GC_IS_TRACKED(op)) {
gc_restore_refs(op);
return true;
}
}
}
// We repurpose ob_tid to compute "gc_refs", the number of external