]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] 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:12:54 +0000 (10:12 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jul 2024 08:12:54 +0000 (08:12 +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 5ae1ee9a89af84c3fb0478a936fde03a14b957c8..371fb074387bbd2d796c4a245f607d9ca15a3fd5 100644 (file)
@@ -1132,7 +1132,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 = TUPLE_FREELIST.items[index];
         if (op != NULL) {