mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-116604: Correctly honor the gc status when calling _Py_RunGC (#116628)
This commit is contained in:
parent
eb947cdc13
commit
02918aa961
3 changed files with 32 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue