Skip to content

Commit ac4276c

Browse files
[3.12] GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428) (#121566)
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 e1a2234 commit ac4276c

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
@@ -1139,7 +1139,7 @@ maybe_freelist_pop(Py_ssize_t size)
11391139
return NULL;
11401140
}
11411141
assert(size > 0);
1142-
if (size < PyTuple_MAXSAVESIZE) {
1142+
if (size <= PyTuple_MAXSAVESIZE) {
11431143
Py_ssize_t index = size - 1;
11441144
PyTupleObject *op = STATE.free_list[index];
11451145
if (op != NULL) {

0 commit comments

Comments
 (0)