Skip to content

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

Merged
sthagen merged 1 commit into
sthagen:masterfrom
python:master
Feb 5, 2020
Merged

bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)#227
sthagen merged 1 commit into
sthagen:masterfrom
python:master

Conversation

@sthagen

@sthagen sthagen commented Feb 5, 2020

Copy link
Copy Markdown
Owner

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()

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()
@sthagen
sthagen merged commit e7c14df into sthagen:master Feb 5, 2020
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.

2 participants