bpo-40521: Make context free list per-interpreter (GH-20644)

Each interpreter now has its own context free list:

* Move context free list into PyInterpreterState.
* Add _Py_context_state structure.
* Add tstate parameter to _PyContext_ClearFreeList()
  and _PyContext_Fini().
* Pass tstate to clear_freelists().
This commit is contained in:
Victor Stinner 2020-06-05 02:56:37 +02:00 committed by GitHub
parent 78a02c2568
commit e005ead49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 28 deletions

View file

@ -171,7 +171,7 @@ extern void _PyFloat_ClearFreeList(PyThreadState *tstate);
extern void _PyList_ClearFreeList(PyThreadState *tstate);
extern void _PyDict_ClearFreeList(void);
extern void _PyAsyncGen_ClearFreeLists(PyThreadState *tstate);
extern void _PyContext_ClearFreeList(void);
extern void _PyContext_ClearFreeList(PyThreadState *tstate);
#ifdef __cplusplus
}