bpo-37257: obmalloc: stop simple arena thrashing (#14039)
GH-14039: allow (no more than) one wholly empty arena on the usable_arenas list. This prevents thrashing in some easily-provoked simple cases that could end up creating and destroying an arena on each loop iteration in client code. Intuitively, if the only arena on the list becomes empty, it makes scant sense to give it back to the system unless we know we'll never need another free pool again before another arena frees a pool. If the latter obtains, then - yes - this will "waste" an arena.
T
Tim Peters committed
d1c85a27ea9fe70163cad3443d5e534d94f08284
Parent: 3a2883c
Committed by GitHub <noreply@github.com>
on 6/13/2019, 3:41:03 AM