mirror of
https://github.com/python/cpython.git
synced 2025-09-04 16:01:10 +00:00
bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)
Move private _PyGC_CollectNoFail() to the internal C API. Remove the private _PyGC_CollectIfEnabled() which was just an alias to the public PyGC_Collect() function since Python 3.8. Rename functions: * collect() => gc_collect_main() * collect_with_callback() => gc_collect_with_callback() * collect_generations() => gc_collect_generations()
This commit is contained in:
parent
99608c733c
commit
8b3414818f
5 changed files with 25 additions and 34 deletions
|
@ -566,7 +566,7 @@ _PyImport_Cleanup(PyThreadState *tstate)
|
|||
}
|
||||
Py_XDECREF(dict);
|
||||
/* Collect references */
|
||||
_PyGC_CollectNoFail();
|
||||
_PyGC_CollectNoFail(tstate);
|
||||
/* Dump GC stats before it's too late, since it uses the warnings
|
||||
machinery. */
|
||||
_PyGC_DumpShutdownStats(tstate);
|
||||
|
@ -626,7 +626,7 @@ _PyImport_Cleanup(PyThreadState *tstate)
|
|||
Py_DECREF(modules);
|
||||
|
||||
/* Once more */
|
||||
_PyGC_CollectNoFail();
|
||||
_PyGC_CollectNoFail(tstate);
|
||||
|
||||
#undef CLEAR_MODULE
|
||||
#undef STORE_MODULE_WEAKREF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue