Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(23)

Side by Side Diff: Include/methodobject.h

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Patch Set: Created 3 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Include/descrobject.h ('k') | Include/object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Method object interface */ 2 /* Method object interface */
3 3
4 #ifndef Py_METHODOBJECT_H 4 #ifndef Py_METHODOBJECT_H
5 #define Py_METHODOBJECT_H 5 #define Py_METHODOBJECT_H
6 #ifdef __cplusplus 6 #ifdef __cplusplus
7 extern "C" { 7 extern "C" {
8 #endif 8 #endif
9 9
10 /* This is about the type 'builtin_function_or_method', 10 /* This is about the type 'builtin_function_or_method',
11 not Python methods in user-defined classes. See classobject.h 11 not Python methods in user-defined classes. See classobject.h
12 for the latter. */ 12 for the latter. */
13 13
14 PyAPI_DATA(PyTypeObject) PyCFunction_Type; 14 PyAPI_DATA(PyTypeObject) PyCFunction_Type;
15 15
16 #define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type) 16 #define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type)
17 17
18 typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); 18 typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
19 typedef PyObject *(*_PyCFunctionFast) (PyObject *self, PyObject **args,
20 Py_ssize_t nargs, PyObject *kwnames);
21 typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, 19 typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
22 PyObject *); 20 PyObject *);
23 typedef PyObject *(*PyNoArgsFunction)(PyObject *); 21 typedef PyObject *(*PyNoArgsFunction)(PyObject *);
24 22
25 PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *); 23 PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *);
26 PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *); 24 PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);
27 PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *); 25 PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);
28 26
29 /* Macros for direct access to these values. Type checks are *not* 27 /* Macros for direct access to these values. Type checks are *not*
30 done, so use with care. */ 28 done, so use with care. */
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #define METH_FASTCALL 0x0080 87 #define METH_FASTCALL 0x0080
90 88
91 typedef struct { 89 typedef struct {
92 PyObject_HEAD 90 PyObject_HEAD
93 PyMethodDef *m_ml; /* Description of the C function to call */ 91 PyMethodDef *m_ml; /* Description of the C function to call */
94 PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ 92 PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
95 PyObject *m_module; /* The __module__ attribute, can be anything */ 93 PyObject *m_module; /* The __module__ attribute, can be anything */
96 PyObject *m_weakreflist; /* List of weak references */ 94 PyObject *m_weakreflist; /* List of weak references */
97 } PyCFunctionObject; 95 } PyCFunctionObject;
98 96
99 PyAPI_FUNC(PyObject *) _PyMethodDef_RawFastCallDict( 97 PyAPI_FUNC(PyObject *) _PyMethodDef_RawFastCallKeywords(
100 PyMethodDef *method, 98 PyMethodDef *method,
101 PyObject *self, 99 PyObject *self,
102 PyObject **args, 100 PyObject **args,
103 Py_ssize_t nargs, 101 Py_ssize_t nargs,
104 PyObject *kwargs); 102 PyObject *kwnames);
105 #endif 103 #endif
106 104
107 PyAPI_FUNC(int) PyCFunction_ClearFreeList(void); 105 PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
108 106
109 #ifndef Py_LIMITED_API 107 #ifndef Py_LIMITED_API
110 PyAPI_FUNC(void) _PyCFunction_DebugMallocStats(FILE *out); 108 PyAPI_FUNC(void) _PyCFunction_DebugMallocStats(FILE *out);
111 PyAPI_FUNC(void) _PyMethod_DebugMallocStats(FILE *out); 109 PyAPI_FUNC(void) _PyMethod_DebugMallocStats(FILE *out);
112 #endif 110 #endif
113 111
114 #ifdef __cplusplus 112 #ifdef __cplusplus
115 } 113 }
116 #endif 114 #endif
117 #endif /* !Py_METHODOBJECT_H */ 115 #endif /* !Py_METHODOBJECT_H */
OLDNEW
« no previous file with comments | « Include/descrobject.h ('k') | Include/object.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+