8000 bpo-39542: Make PyObject_INIT() opaque in limited C API by vstinner · Pull Request #18363 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-39542: Make PyObject_INIT() opaque in limited C API #18363

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

Merged
merged 1 commit into from
Feb 5, 2020
Merged

bpo-39542: Make PyObject_INIT() opaque in limited C API #18363

merged 1 commit into from
Feb 5, 2020

Conversation

vstinner
Copy link
Member
@vstinner vstinner commented Feb 5, 2020

In the limited C API, PyObject_INIT() and PyObject_INIT_VAR() are now
defined as aliases to PyObject_Init() and PyObject_InitVar() to make
their implementation opaque. It avoids to leak implementation details
in the limited C API.

Exclude the following functions from the limited C API, move them
from object.h to cpython/object.h:

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

https://bugs.python.org/issue39542

In the limited C API, PyObject_INIT() and PyObject_INIT_VAR() are now
defined as aliases to PyObject_Init() and PyObject_InitVar() to make
their implementation opaque. It avoids to leak implementation details
in the limited C API.

Exclude the following functions from the limited C API, move them
from object.h to cpython/object.h:

* _Py_NewReference()
* _Py_ForgetReference()
* _PyTraceMalloc_NewReference()
* _Py_GetRefTotal()
@vstinner vstinner merged commit f58bd7c into python:master Feb 5, 2020
@vstinner vstinner deleted the debug_funcs branch February 5, 2020 12:13
sthagen added a commit to sthagen/python-cpython that referenced this pull request Feb 5, 2020
bpo-39542: Make PyObject_INIT() opaque in limited C API (pythonGH-18363)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0