[3.13] gh-130794: Process interpreter QSBR queue in _PyMem_AbandonDelayed. (gh-130808) (#130857)

This avoids a case where the interpreter's queue of memory to be freed
could grow rapidly if there are many short lived threads.
(cherry picked from commit 2f6e0e9f70)
This commit is contained in:
Sam Gross 2025-03-04 18:35:22 -05:00 committed by GitHub
parent 22d729cf5d
commit 07522755ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 8 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;