Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Feb 26, 2022

_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.

https://bugs.python.org/issue46857

_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.
Copy link
Contributor

@jkloth jkloth left a comment

Choose a reason for hiding this comment

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

Seems to work, although do not forget to test with buildbots!

total -= Py_REFCNT(o);
return total;
return _Py_RefTotal;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is no longer needed, more the better, but I haven't been testing this change

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, this is the change that makes total refs 0!

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, this is the change that makes total refs 0!

Without this change, _Py_GetRefTotal() returns -2 when the Python process is started, before calling Py_Initialiaze() (ex: if you put a breakpoint on the main() function).

@vstinner vstinner merged commit ad56919 into python:main Feb 26, 2022
@vstinner vstinner deleted the oserror_alias_refleak branch February 26, 2022 23:28
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