From c52572319cbd50adff85050a54122c25239a516d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 18 Jan 2017 10:38:09 +0100 Subject: Optimize methoddescr_call(): avoid temporary PyCFunction Issue #29259, #29263. methoddescr_call() creates a PyCFunction object, call it and the destroy it. Add a new _PyMethodDef_RawFastCallDict() method to avoid the temporary PyCFunction object. --- Include/methodobject.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Include/methodobject.h') diff --git a/Include/methodobject.h b/Include/methodobject.h index 79fad8235c..7370419c39 100644 --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -95,6 +95,13 @@ typedef struct { PyObject *m_module; /* The __module__ attribute, can be anything */ PyObject *m_weakreflist; /* List of weak references */ } PyCFunctionObject; + +PyAPI_FUNC(PyObject *) _PyMethodDef_RawFastCallDict( + PyMethodDef *method, + PyObject *self, + PyObject **args, + Py_ssize_t nargs, + PyObject *kwargs); #endif PyAPI_FUNC(int) PyCFunction_ClearFreeList(void); -- cgit v1.2.1