]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)
authorVictor Stinner <vstinner@python.org>
Wed, 5 Feb 2020 12:12:19 +0000 (13:12 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2020 12:12:19 +0000 (13:12 +0100)
commitf58bd7c1693fe041f7296a5778d0a11287895648
tree066423d4c91278ace5f1f9159436fc2917ed2af8
parent0fa4f43db086ac3459811cca4ec5201ffbee694a
bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)

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()
Include/cpython/object.h
Include/cpython/objimpl.h
Include/object.h
Include/objimpl.h
Misc/NEWS.d/next/C API/2020-02-05-12-40-51.bpo-39542.si-_Zq.rst [new file with mode: 0644]
Objects/object.c