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