FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-40989: Move _Py_NewReference() to the internal C API by vstinner · Pull Request #20904 · python/cpython · GitHub

Repository navigation

bpo-40989: Move _Py_NewReference() to the internal C API - #20904

Closed
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:make_new_ref_internal
Closed

vstinner wants to merge 1 commit into
python:mainfrom
vstinner:make_new_ref_internal

Conversation

vstinner commented Jun 15, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Remove the _Py_NewReference() function from the public C API (move it
to the internal C API).

https://bugs.python.org/issue40989

Copy link
Copy Markdown
Member Author

I ran a quick test on Cython, numpy and lxml: all projects 3 builds successful. I had to backport a few patches for numpy, to fix another unrelated incompatible changes. I didn't run their test suite.

Copy link
Copy Markdown
Member Author

I completed my PR to remove more functions:

  • _Py_NewReference()
  • _Py_ForgetReference()
  • _Py_GetRefTotal()
  • _PyTraceMalloc_NewReference()

Remove the _Py_NewReference() and _Py_ForgetReference() functions
from the public C API: move them to the internal C API.

Move with_tp_del() test function from the _testcapi module to the
_testinternalcapi module.

Copy link
Copy Markdown
Member Author

This PR now only makes two (related) functions internals:

  • _Py_NewReference()
  • _Py_ForgetReference()

I rebased this PR on top of PR #20915 which made _PyTraceMalloc_NewReference() fully internal (don't export it anymore).

I changed my mind on _Py_GetRefTotal(): for now, it's fine to keep it as a private function, since sys._gettotalrefcount() private function exists at the Python level.

vstinner closed this Sep 21, 2021
vstinner deleted the make_new_ref_internal branch September 21, 2021 21:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL