From e365b33dbd2a47248bc53a8194ca44d3dd334a7e Mon Sep 17 00:00:00 2001 From: satori1995 <132636720+satori1995@users.noreply.github.com> Date: Sat, 6 Jul 2024 19:34:11 +0800 Subject: [PATCH 1/6] Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused --- Objects/tupleobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 994258f20b495d..3704d095a977ea 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -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) { From 1a177ee5d33531652fa2477a8b24fcb60430547d Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 02:24:56 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst 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 index 00000000000000..5685057a069ecb --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst @@ -0,0 +1 @@ +Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused From 16416d61fafe9a3a740d39a57269a4ed0b77e8a9 Mon Sep 17 00:00:00 2001 From: satori1995 <132636720+satori1995@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:30:27 +0800 Subject: [PATCH 3/6] Update Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst Co-authored-by: Pieter Eendebak --- .../2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 5685057a069ecb..e4d6cff80929b3 100644 --- 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 @@ -1 +1 @@ -Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused +Allow `PyTupleObjects` with an `ob_size` of 20 in the `free_list` to be reused From 381d0f78056fbc91d2bb763186d0ad6d3668b9d4 Mon Sep 17 00:00:00 2001 From: satori1995 <132636720+satori1995@users.noreply.github.com> Date: Tue, 9 Jul 2024 21:50:06 +0800 Subject: [PATCH 4/6] Update Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst I have made the requested changes Co-authored-by: Pieter Eendebak --- .../2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index e4d6cff80929b3..12a43a54d24efd 100644 --- 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 @@ -1 +1 @@ -Allow `PyTupleObjects` with an `ob_size` of 20 in the `free_list` to be reused +Allow ``PyTupleObjects`` with an ``ob_size`` of 20 in the ``free_list`` to be reused From 1f61d43379afede139719bb416ea22264728fdcd Mon Sep 17 00:00:00 2001 From: satori1995 <132636720+satori1995@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:06:11 +0800 Subject: [PATCH 5/6] Update Misc/NEWS.d/next/Core and Builtins/2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst Co-authored-by: Pieter Eendebak --- .../2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 12a43a54d24efd..ac198381d3779f 100644 --- 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 @@ -1 +1 @@ -Allow ``PyTupleObjects`` with an ``ob_size`` of 20 in the ``free_list`` to be reused +Allow :c:type:`PyTupleObject` with an :c:member:`~PyTypeObject.ob_size` of 20 in the freelist of tuples to be reused. From d407ae159c894b884da78684907e5845426a5841 Mon Sep 17 00:00:00 2001 From: satori1995 <132636720+satori1995@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:58:09 +0800 Subject: [PATCH 6/6] Update 2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst --- .../2024-07-08-02-24-55.gh-issue-121439.jDHod3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index ac198381d3779f..361f9fc71186c6 100644 --- 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 @@ -1 +1 @@ -Allow :c:type:`PyTupleObject` with an :c:member:`~PyTypeObject.ob_size` of 20 in the freelist of tuples to be reused. +Allow tuples of length 20 in the freelist to be reused.