mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-126703: Add freelists for list and tuple iterators (GH-128592)
This commit is contained in:
parent
41ad2bb248
commit
1a80214f11
5 changed files with 24 additions and 12 deletions
|
@ -11,6 +11,8 @@ extern "C" {
|
|||
# define PyTuple_MAXSAVESIZE 20 // Largest tuple to save on freelist
|
||||
# define Py_tuple_MAXFREELIST 2000 // Maximum number of tuples of each size to save
|
||||
# define Py_lists_MAXFREELIST 80
|
||||
# define Py_list_iters_MAXFREELIST 10
|
||||
# define Py_tuple_iters_MAXFREELIST 10
|
||||
# define Py_dicts_MAXFREELIST 80
|
||||
# define Py_dictkeys_MAXFREELIST 80
|
||||
# define Py_floats_MAXFREELIST 100
|
||||
|
@ -40,6 +42,8 @@ struct _Py_freelists {
|
|||
struct _Py_freelist ints;
|
||||
struct _Py_freelist tuples[PyTuple_MAXSAVESIZE];
|
||||
struct _Py_freelist lists;
|
||||
struct _Py_freelist list_iters;
|
||||
struct _Py_freelist tuple_iters;
|
||||
struct _Py_freelist dicts;
|
||||
struct _Py_freelist dictkeys;
|
||||
struct _Py_freelist slices;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue