[3.15] gh-157377: Don't flush the thread-local allocation count in gc.get_count (GH-157381) by miss-islington · Pull Request #157505 · python/cpython · GitHub
Skip to content

[3.15] gh-157377: Don't flush the thread-local allocation count in gc.get_count (GH-157381) - #157505

Merged
hugovk merged 1 commit into
python:3.15from
miss-islington:backport-c215919-3.15
Sep 16, 2026
Merged

hugovk merged 1 commit into
python:3.15from
miss-islington:backport-c215919-3.15

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

Co-authored-by: Nathan Goldbaum nathan.goldbaum@gmail.com

…get_count (pythonGH-157381)

* pythongh-157377: Don't flush the thread-local allocation count in gc.get_count()

* pythongh-157377: clamp gc.get_count() return value at zero
(cherry picked from commit c215919)

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@ngoldbaum

Copy link
Copy Markdown
Contributor

@hugovk

hugovk commented Sep 15, 2026

Copy link
Copy Markdown
Member

This can go into 3.15.0 if you like, please get core peer review first:

https://discuss.python.org/t/the-3-15-branch-is-locked-for-rc1/108389

@ngoldbaum

Copy link
Copy Markdown
Contributor

@kumaraditya303 kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hugovk
hugovk merged commit 0ed896f into python:3.15 Sep 16, 2026
62 checks passed
@miss-islington
miss-islington deleted the backport-c215919-3.15 branch September 16, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants