summaryrefslogtreecommitdiffstats
path: root/Python/gc.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-11-19 13:38:59 (GMT)
committerGitHub <noreply@github.com>2024-11-19 13:38:59 (GMT)
commita99dd23c1f5b9254651d9895714596d5e7942389 (patch)
tree91098ce9aeaae35868d2be80fe6b3719cba19d46 /Python/gc.c
parent6309e9e07a855e08c223a0e295710c8bd66e793d (diff)
downloadcpython-a99dd23c1f5b9254651d9895714596d5e7942389.zip
cpython-a99dd23c1f5b9254651d9895714596d5e7942389.tar.gz
cpython-a99dd23c1f5b9254651d9895714596d5e7942389.tar.bz2
GH-124567: Replace quadratic assert with linear one (GH-127009)
Diffstat (limited to 'Python/gc.c')
-rw-r--r--Python/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/gc.c b/Python/gc.c
index fe81ca5..a774183 100644
--- a/Python/gc.c
+++ b/Python/gc.c
@@ -1394,7 +1394,6 @@ visit_add_to_container(PyObject *op, void *arg)
static uintptr_t
expand_region_transitively_reachable(PyGC_Head *container, PyGC_Head *gc, GCState *gcstate)
{
- validate_list(container, collecting_clear_unreachable_clear);
struct container_and_flag arg = {
.container = container,
.visited_space = gcstate->visited_space,
@@ -1468,6 +1467,7 @@ gc_collect_increment(PyThreadState *tstate, struct gc_collection_stats *stats)
gc_set_old_space(gc, gcstate->visited_space);
increment_size += expand_region_transitively_reachable(&increment, gc, gcstate);
}
+ validate_list(&increment, collecting_clear_unreachable_clear);
gc_list_validate_space(&increment, gcstate->visited_space);
PyGC_Head survivors;
gc_list_init(&survivors);