Skip to content

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

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

Closed
satori1995 opened this issue Jul 6, 2024 · 0 comments
Closed

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

satori1995 opened this issue Jul 6, 2024 · 0 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@satori1995
Copy link
Contributor

satori1995 commented Jul 6, 2024

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

@satori1995 satori1995 added the type-bug An unexpected behavior, bug, or error label Jul 6, 2024
@satori1995 satori1995 changed the title Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused PyTupleObjects with an ob_size of 20 are not reused. Jul 6, 2024
@sobolevn sobolevn added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jul 6, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 10, 2024
…ee_list to be reused (pythongh-121428)

(cherry picked from commit 9585a1a)

Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 10, 2024
…ee_list to be reused (pythongh-121428)

(cherry picked from commit 9585a1a)

Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
corona10 pushed a commit that referenced this issue Jul 10, 2024
…ree_list to be reused (gh-121428) (#121566)

GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428)
(cherry picked from commit 9585a1a)

Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
corona10 pushed a commit that referenced this issue Jul 10, 2024
…ree_list to be reused (gh-121428) (gh-121565)

GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428)
(cherry picked from commit 9585a1a)

Co-authored-by: satori1995 <132636720+satori1995@users.noreply.github.com>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants