diff options
| author | Petr Viktorin <encukou@gmail.com> | 2022-08-08 14:12:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-08 14:12:05 +0200 |
| commit | 656dad702d3b25bf678ee9bd7109d98876946258 (patch) | |
| tree | d532248aca4a64f0ad9fb431f34398c1afc05ff5 /Include/cpython | |
| parent | cc9160a29bc3356ced92348bcd8e6668c67167c9 (diff) | |
| download | cpython-git-656dad702d3b25bf678ee9bd7109d98876946258.tar.gz | |
gh-93274: Expose receiving vectorcall in the Limited API (GH-95717)
Diffstat (limited to 'Include/cpython')
| -rw-r--r-- | Include/cpython/abstract.h | 10 | ||||
| -rw-r--r-- | Include/cpython/object.h | 3 |
2 files changed, 5 insertions, 8 deletions
diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h index 7038918f01..6da29cde9f 100644 --- a/Include/cpython/abstract.h +++ b/Include/cpython/abstract.h @@ -53,8 +53,12 @@ PyAPI_FUNC(PyObject *) _PyObject_MakeTpCall( #define PY_VECTORCALL_ARGUMENTS_OFFSET \ (_Py_STATIC_CAST(size_t, 1) << (8 * sizeof(size_t) - 1)) +// PyVectorcall_NARGS() is exported as a function for the stable ABI. +// Here (when we are not using the stable ABI), the name is overridden to +// call a static inline function for best performance. +#define PyVectorcall_NARGS(n) _PyVectorcall_NARGS(n) static inline Py_ssize_t -PyVectorcall_NARGS(size_t n) +_PyVectorcall_NARGS(size_t n) { return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET; } @@ -84,10 +88,6 @@ PyAPI_FUNC(PyObject *) PyObject_VectorcallDict( size_t nargsf, PyObject *kwargs); -/* Call "callable" (which must support vectorcall) with positional arguments - "tuple" and keyword arguments "dict". "dict" may also be NULL */ -PyAPI_FUNC(PyObject *) PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict); - // Same as PyObject_Vectorcall(), except without keyword arguments PyAPI_FUNC(PyObject *) _PyObject_FastCall( PyObject *func, diff --git a/Include/cpython/object.h b/Include/cpython/object.h index a26fc7f6aa..c80fc1df0e 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -54,9 +54,6 @@ typedef struct _Py_Identifier { typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); typedef void (*releasebufferproc)(PyObject *, Py_buffer *); -typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - typedef struct { /* Number implementations must check *both* |
