summaryrefslogtreecommitdiffstats
path: root/Include/methodobject.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-18 09:38:09 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-18 09:38:09 (GMT)
commitc52572319cbd50adff85050a54122c25239a516d (patch)
tree41e964e6b6a25c655496561a32ce97c0f14ce253 /Include/methodobject.h
parent35ecebe165b1f64cb94c1b947db1d0b07e6db69b (diff)
downloadcpython-c52572319cbd50adff85050a54122c25239a516d.zip
cpython-c52572319cbd50adff85050a54122c25239a516d.tar.gz
cpython-c52572319cbd50adff85050a54122c25239a516d.tar.bz2
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.
Diffstat (limited to 'Include/methodobject.h')
-rw-r--r--Include/methodobject.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/methodobject.h b/Include/methodobject.h
index 79fad82..7370419 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);