mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-126502)
* Mark almost all reachable objects before doing collection phase * Add stats for objects marked * Visit new frames before each increment * Remove lazy dict tracking * Update docs * Clearer calculation of work to do.
This commit is contained in:
parent
a1d9c8aa80
commit
b0fcc2c47a
21 changed files with 332 additions and 330 deletions
|
@ -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" // _PyDict_MaybeUntrack()
|
||||
#include "pycore_dict.h" // _PyInlineValuesSize()
|
||||
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
|
||||
#include "pycore_initconfig.h"
|
||||
#include "pycore_interp.h" // PyInterpreterState.gc
|
||||
|
@ -493,13 +493,6 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue