8000 gh-116397: Clear freelists during stop-the-world · colesbury/cpython@2fb90fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 2fb90fb

Browse files
committed
pythongh-116397: Clear freelists during stop-the-world
1 parent d2f1b0e commit 2fb90fb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Python/gc_free_threading.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ gc_collect_internal(PyInterpreterState *interp, struct collection_state *state)
10581058
// Handle any objects that may have resurrected after the finalization.
10591059
_PyEval_StopTheWorld(interp);
10601060
err = handle_resurrected_objects(state);
1061+
// Clear free lists in all threads
1062+
_PyGC_ClearAllFreeLists(interp);
10611063
_PyEval_StartTheWorld(interp);
10621064

10631065
if (err < 0) {
@@ -1160,9 +1162,6 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason)
11601162
n+m, n, d);
11611163
}
11621164

1163-
// Clear free lists in all threads
1164-
_PyGC_ClearAllFreeLists(interp);
1165-
11661165
if (_PyErr_Occurred(tstate)) {
11671166
if (reason == _Py_GC_REASON_SHUTDOWN) {
11681167
_PyErr_Clear(tstate);

0 commit comments

Comments
 (0)
0