Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-122420: Fix accounting for immortal interned strings in refleak.py (
…GH-122421)

The `_PyUnicode_Intern*` functions already adjust the total refcount, so
we don't want to readjust it in refleak.py.
(cherry picked from commit ac8da34)

Co-authored-by: Sam Gross <colesbury@gmail.com>
  • Loading branch information
colesbury authored and miss-islington committed Jul 29, 2024
commit 1b1daab557affacefd8f3289e48ba694bb28b504
2 changes: 1 addition & 1 deletion Lib/test/libregrtest/refleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_pooled_int(value):
# Use an internal-only keyword argument that mypy doesn't know yet
_only_immortal=True) # type: ignore[call-arg]
alloc_after = getallocatedblocks() - interned_immortal_after
rc_after = gettotalrefcount() - interned_immortal_after * 2
rc_after = gettotalrefcount()
fd_after = fd_count()

rc_deltas[i] = get_pooled_int(rc_after - rc_before)
Expand Down