Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused #121428

Merged
merged 8 commits into from
Jul 10, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow `PyTupleObjects` with an `ob_size` of 20 in the `free_list` to be reused
satori1995 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Objects/tupleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading