gh-130794: Process interpreter QSBR queue in _PyMem_AbandonDelayed. (gh-130808)

This avoids a case where the interpreter's queue of memory to be freed
could grow rapidly if there are many short lived threads.
This commit is contained in:
Sam Gross 2025-03-04 18:04:04 -05:00 committed by GitHub
parent cb67b44ca9
commit 2f6e0e9f70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 9 deletions

View file

@ -161,6 +161,7 @@ bool
_Py_qsbr_poll(struct _qsbr_thread_state *qsbr, uint64_t goal)
{
assert(_Py_atomic_load_int_relaxed(&_PyThreadState_GET()->state) == _Py_THREAD_ATTACHED);
assert(((_PyThreadStateImpl *)_PyThreadState_GET())->qsbr == qsbr);
if (_Py_qbsr_goal_reached(qsbr, goal)) {
return true;