mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +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
|
@ -2077,6 +2077,12 @@ has_deferred_refcount(PyObject *self, PyObject *op)
|
|||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
get_heap_size(PyObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return PyLong_FromInt64(PyInterpreterState_Get()->gc.heap_size);
|
||||
}
|
||||
|
||||
static PyMethodDef module_functions[] = {
|
||||
{"get_configs", get_configs, METH_NOARGS},
|
||||
{"get_recursion_depth", get_recursion_depth, METH_NOARGS},
|
||||
|
@ -2174,6 +2180,7 @@ static PyMethodDef module_functions[] = {
|
|||
{"get_static_builtin_types", get_static_builtin_types, METH_NOARGS},
|
||||
{"identify_type_slot_wrappers", identify_type_slot_wrappers, METH_NOARGS},
|
||||
{"has_deferred_refcount", has_deferred_refcount, METH_O},
|
||||
{"get_heap_size", get_heap_size, METH_NOARGS},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue