mirror of https://github.com/python/cpython
[3.13] GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428) (gh-121565)
GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428)
(cherry picked from commit 9585a1a2a2
)
Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
This commit is contained in:
parent
3824dc9fa3
commit
a1fc8d31a7
|
@ -0,0 +1 @@
|
|||
Allow tuples of length 20 in the freelist to be reused.
|
|
@ -1132,7 +1132,7 @@ maybe_freelist_pop(Py_ssize_t size)
|
|||
return NULL;
|
||||
}
|
||||
assert(size > 0);
|
||||
if (size < PyTuple_MAXSAVESIZE) {
|
||||
if (size <= PyTuple_MAXSAVESIZE) {
|
||||
Py_ssize_t index = size - 1;
|
||||
PyTupleObject *op = TUPLE_FREELIST.items[index];
|
||||
if (op != NULL) {
|
||||
|
|
Loading…
Reference in New Issue