mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
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.
This commit is contained in:
parent
35ecebe165
commit
c52572319c
3 changed files with 40 additions and 26 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue