mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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:
parent
78a02c2568
commit
e005ead49b
7 changed files with 34 additions and 28 deletions
|
@ -124,6 +124,12 @@ struct _Py_async_gen_state {
|
|||
int asend_numfree;
|
||||
};
|
||||
|
||||
struct _Py_context_state {
|
||||
// List of free PyContext objects
|
||||
PyContext *freelist;
|
||||
int numfree;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* interpreter state */
|
||||
|
@ -223,6 +229,7 @@ struct _is {
|
|||
struct _Py_float_state float_state;
|
||||
struct _Py_frame_state frame;
|
||||
struct _Py_async_gen_state async_gen;
|
||||
struct _Py_context_state context;
|
||||
|
||||
/* Using a cache is very effective since typically only a single slice is
|
||||
created and then deleted again. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue