mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077)
This is a precursor to the actual fix for gh-114940, where we will change these macros to use the new lock. This change is almost entirely mechanical; the exceptions are the loops in codeobject.c and ceval.c, which now hold the "head" lock. Note that almost all of the uses of _Py_FOR_EACH_TSTATE_UNLOCKED() here will change to _Py_FOR_EACH_TSTATE_BEGIN() once we add the new per-interpreter lock.
This commit is contained in:
parent
bf542f8bb9
commit
9dabace39d
9 changed files with 79 additions and 87 deletions
|
|
@ -1439,7 +1439,7 @@ get_mimalloc_allocated_blocks(PyInterpreterState *interp)
|
|||
{
|
||||
size_t allocated_blocks = 0;
|
||||
#ifdef Py_GIL_DISABLED
|
||||
for (PyThreadState *t = interp->threads.head; t != NULL; t = t->next) {
|
||||
_Py_FOR_EACH_TSTATE_UNLOCKED(interp, t) {
|
||||
_PyThreadStateImpl *tstate = (_PyThreadStateImpl *)t;
|
||||
for (int i = 0; i < _Py_MIMALLOC_HEAP_COUNT; i++) {
|
||||
mi_heap_t *heap = &tstate->mimalloc.heaps[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue