Skip to content

PyTupleObjects with an ob_size of 20 are not reused. #121439

Closed
@satori1995

Description

@satori1995

Bug report

Bug description:

In the maybe_freelist_push function, PyTupleObjects with an ob_size of 20 are being stored in the free_list for potential reuse. However, in the maybe_freelist_pop function, these objects aren't actually being reused.

// Objects/tupleobject.c
static inline int
maybe_freelist_push(PyTupleObject *op) {
  // ....
}

static inline PyTupleObject *
maybe_freelist_pop(Py_ssize_t size) {
  // ...
}

I've already submitted a PR.
Here is the link to the PR: #121428

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions