Skip to content

Commit

Permalink
[3.12] GH-121439: Allow PyTupleObjects with an ob_size of 20 in the f…
Browse files Browse the repository at this point in the history
…ree_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>
  • Loading branch information
miss-islington and satori1995 committed Jul 10, 2024
1 parent e1a2234 commit ac4276c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow tuples of length 20 in the freelist to be reused.
2 changes: 1 addition & 1 deletion Objects/tupleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,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 = STATE.free_list[index];
if (op != NULL) {
Expand Down

0 comments on commit ac4276c

Please sign in to comment.