bpo-40521: Make async gen free lists per-interpreter (GH-20643)

Each interpreter now has its own asynchronous generator free lists:

* Move async gen free lists into PyInterpreterState.
* Move _PyAsyncGen_MAXFREELIST define to pycore_interp.h
* Add _Py_async_gen_state structure.
* Add tstate parameter to _PyAsyncGen_ClearFreeLists
  and _PyAsyncGen_Fini().
This commit is contained in:
Victor Stinner 2020-06-05 02:34:14 +02:00 committed by GitHub
parent 88ec919010
commit 78a02c2568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 46 deletions

View file

@ -1031,7 +1031,7 @@ clear_freelists(void)
_PyFloat_ClearFreeList(tstate);
_PyList_ClearFreeList(tstate);
_PyDict_ClearFreeList();
_PyAsyncGen_ClearFreeLists();
_PyAsyncGen_ClearFreeLists(tstate);
_PyContext_ClearFreeList();
}