gh-126703: Add freelists for list and tuple iterators (GH-128592)

This commit is contained in:
Pieter Eendebak 2025-01-29 10:15:24 +01:00 committed by GitHub
parent 41ad2bb248
commit 1a80214f11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 12 deletions

View file

@ -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;