]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 10 Jul 2024 08:06:41 +0000 (10:06 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jul 2024 08:06:41 +0000 (08:06 +0000)
GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428)
(cherry picked from commit 9585a1a2a251aaa15baf6579e13dd3be0cb05f1f)

Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst [new file with mode: 0644]
Objects/tupleobject.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst b/Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst
new file mode 100644 (file)
index 0000000..361f9fc
--- /dev/null
@@ -0,0 +1 @@
+Allow tuples of length 20 in the freelist to be reused.
index 991edcc86677de9376c0a94c1ac966c1b44a74cf..918654fae898e7dd1cd2d1c705b49fbb2b9bf1ec 100644 (file)
@@ -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) {