gh-114626: add PyCFunctionFast and PyCFunctionFastWithKeywords (GH-114627)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
David Hewitt 2024-02-15 10:05:20 +00:00 committed by GitHub
parent 32f8ab1ab6
commit 9e3729bbd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 57 additions and 41 deletions

View file

@ -417,7 +417,7 @@ cfunction_vectorcall_FASTCALL(
return NULL;
}
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
_PyCFunctionFast meth = (_PyCFunctionFast)
PyCFunctionFast meth = (PyCFunctionFast)
cfunction_enter_call(tstate, func);
if (meth == NULL) {
return NULL;
@ -433,7 +433,7 @@ cfunction_vectorcall_FASTCALL_KEYWORDS(
{
PyThreadState *tstate = _PyThreadState_GET();
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
_PyCFunctionFastWithKeywords meth = (_PyCFunctionFastWithKeywords)
PyCFunctionFastWithKeywords meth = (PyCFunctionFastWithKeywords)
cfunction_enter_call(tstate, func);
if (meth == NULL) {
return NULL;
@ -552,4 +552,3 @@ cfunction_call(PyObject *func, PyObject *args, PyObject *kwargs)
}
return _Py_CheckFunctionResult(tstate, func, result, NULL);
}