8000 gh-116604: Correctly honor the gc status when calling _Py_RunGC · python/cpython@1ff8bec · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ff8bec

Browse files
committed
gh-116604: Correctly honor the gc status when calling _Py_RunGC
1 parent 3e45030 commit 1ff8bec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/gc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,10 @@ _PyObject_GC_Link(PyObject *op)
18051805
void
18061806
_Py_RunGC(PyThreadState *tstate)
18071807
{
1808+
GCState *gcstate = get_gc_state();
1809+
if (!gcstate->enabled) {
1810+
return;
1811+
}
18081812
gc_collect_main(tstate, GENERATION_AUTO, _Py_GC_REASON_HEAP);
18091813
}
18101814

0 commit comments

Comments
 (0)
0