Skip to content

Commit

Permalink
gh-106320: Remove _PyFunction_Vectorcall() API
Browse files Browse the repository at this point in the history
Move _PyFunction_Vectorcall() API to the internal C API.
No longer export the function.
  • Loading branch information
vstinner committed Jul 22, 2023
1 parent 5e5a34a commit ae8407a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Include/cpython/funcobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);

PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
PyObject *func,
PyObject *const *stack,
size_t nargsf,
PyObject *kwnames);

#define _PyFunction_CAST(func) \
(assert(PyFunction_Check(func)), _Py_CAST(PyFunctionObject*, func))

Expand Down
6 changes: 6 additions & 0 deletions Include/internal/pycore_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif

extern PyObject* _PyFunction_Vectorcall(
PyObject *func,
PyObject *const *stack,
size_t nargsf,
PyObject *kwnames);

#define FUNC_MAX_WATCHERS 8

struct _py_func_state {
Expand Down
1 change: 1 addition & 0 deletions Objects/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "pycore_call.h" // _PyObject_CallNoArgsTstate()
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
#include "pycore_dict.h" // _PyDict_FromItems()
#include "pycore_function.h" // _PyFunction_Vectorcall() definition
#include "pycore_modsupport.h" // _Py_VaBuildStack()
#include "pycore_object.h" // _PyCFunctionWithKeywords_TrampolineCall()
#include "pycore_pyerrors.h" // _PyErr_Occurred()
Expand Down

0 comments on commit ae8407a

Please sign in to comment.