Skip to content

Commit a1fc8d3

Browse files
[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 9585a1a) Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
1 parent 3824dc9 commit a1fc8d3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow tuples of length 20 in the freelist to be reused.

Objects/tupleobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ maybe_freelist_pop(Py_ssize_t size)
11321132
return NULL;
11331133
}
11341134
assert(size > 0);
1135-
if (size < PyTuple_MAXSAVESIZE) {
1135+
if (size <= PyTuple_MAXSAVESIZE) {
11361136
Py_ssize_t index = size - 1;
11371137
PyTupleObject *op = TUPLE_FREELIST.items[index];
11381138
if (op != NULL) {

0 commit comments

Comments
 (0)