]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused...
authorsatori1995 <132636720+satori1995@users.noreply.github.com>
Wed, 10 Jul 2024 07:48:25 +0000 (15:48 +0800)
committerGitHub <noreply@github.com>
Wed, 10 Jul 2024 07:48:25 +0000 (07:48 +0000)
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 994258f20b495dffa6921e64c3a2b01cd5ec9387..3704d095a977ea63dd13820e583f4250c33b6807 100644 (file)
@@ -1153,7 +1153,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) {