Browse Source
bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)
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()pull/18364/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 77 additions and 49 deletions
-
16Include/cpython/object.h
-
33Include/cpython/objimpl.h
-
15Include/object.h
-
43Include/objimpl.h
-
7Misc/NEWS.d/next/C API/2020-02-05-12-40-51.bpo-39542.si-_Zq.rst
-
12Objects/object.c
@ -0,0 +1,7 @@ |
|||
In the limited C API, ``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` are |
|||
now defined as aliases to :c:func:`PyObject_Init` and |
|||
:c:func:`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: ``_Py_NewReference()``, |
|||
``_Py_ForgetReference()``, ``_PyTraceMalloc_NewReference()`` and |
|||
``_Py_GetRefTotal()``. |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue