PEP 670: List converted macros (#2120)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
This commit is contained in:
Victor Stinner 2021-10-20 15:55:51 +02:00 committed by GitHub
parent 9afa9ee0b6
commit 6f1fe98031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 62 additions and 0 deletions

View File

@ -284,6 +284,68 @@ single long line. Inside the function, the *op* argument has a well
defined type: ``PyObject*``.
Macros converted to functions since Python 3.8
==============================================
Macros converted to static inline functions
-------------------------------------------
Python 3.8:
* ``Py_DECREF()``
* ``Py_INCREF()``
* ``Py_XDECREF()``
* ``Py_XINCREF()``
* ``PyObject_INIT()``
* ``PyObject_INIT_VAR()``
* ``_PyObject_GC_UNTRACK()``
* ``_Py_Dealloc()``
Python 3.10:
* ``Py_REFCNT()``
Python 3.11:
* ``Py_TYPE()``
* ``Py_SIZE()``
Macros converted to regular functions
-------------------------------------
Python 3.9:
* ``PyIndex_Check()``
* ``PyObject_CheckBuffer()``
* ``PyObject_GET_WEAKREFS_LISTPTR()``
* ``PyObject_IS_GC()``
* ``PyObject_NEW()``: alias to ``PyObject_New()``
* ``PyObject_NEW_VAR()``: alias to ``PyObjectVar_New()``
To avoid any risk of performance slowdown on Python built without LTO,
private static inline functions have been added to the internal C API:
* ``_PyIndex_Check()``
* ``_PyObject_IS_GC()``
* ``_PyType_HasFeature()``
* ``_PyType_IS_GC()``
Static inline functions converted to regular functions
-------------------------------------------------------
Python 3.11:
* ``PyObject_CallOneArg()``
* ``PyObject_Vectorcall()``
* ``PyVectorcall_Function()``
* ``_PyObject_FastCall()``
To avoid any risk of performance slowdown on Python built without LTO, a
private static inline function has been added to the internal C API:
* ``_PyVectorcall_FunctionInline()``
References
==========