summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/gc.c b/Python/gc.c
index ea3b596..6b3316b 100644
--- a/Python/gc.c
+++ b/Python/gc.c
@@ -1805,6 +1805,10 @@ _PyObject_GC_Link(PyObject *op)
void
_Py_RunGC(PyThreadState *tstate)
{
+ GCState *gcstate = get_gc_state();
+ if (!gcstate->enabled) {
+ return;
+ }
gc_collect_main(tstate, GENERATION_AUTO, _Py_GC_REASON_HEAP);
}