summaryrefslogtreecommitdiffstats
path: root/Include/object.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-05 12:12:19 (GMT)
committerGitHub <noreply@github.com>2020-02-05 12:12:19 (GMT)
commitf58bd7c1693fe041f7296a5778d0a11287895648 (patch)
tree066423d4c91278ace5f1f9159436fc2917ed2af8 /Include/object.h
parent0fa4f43db086ac3459811cca4ec5201ffbee694a (diff)
downloadcpython-f58bd7c1693fe041f7296a5778d0a11287895648.zip
cpython-f58bd7c1693fe041f7296a5778d0a11287895648.tar.gz
cpython-f58bd7c1693fe041f7296a5778d0a11287895648.tar.bz2
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()
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/Include/object.h b/Include/object.h
index 4506757..91855d0 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -233,8 +233,7 @@ PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
-PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *,
- PyObject *, PyObject *);
+PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC(int) PyObject_GenericSetDict(PyObject *, PyObject *, void *);
#endif
@@ -381,20 +380,8 @@ you can count such references to the type object.)
PyAPI_DATA(Py_ssize_t) _Py_RefTotal;
PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno,
PyObject *op);
-PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
#endif /* Py_REF_DEBUG */
-/* Update the Python traceback of an object. This function must be called
- when a memory block is reused from a free list. */
-PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op);
-
-PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
-
-#ifdef Py_TRACE_REFS
-/* Py_TRACE_REFS is such major surgery that we call external routines. */
-PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
-#endif
-
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
static inline void _Py_INCREF(PyObject *op)