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

Unified Diff: Include/abstract.h

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Patch Set: Created 3 years ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Include/descrobject.h » ('j') | Objects/abstract.c » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Include/abstract.h Wed Jan 25 23:33:27 2017 +0100
+++ b/Include/abstract.h Thu Jan 26 02:43:18 2017 +0100
@@ -180,23 +180,18 @@ PyAPI_FUNC(PyObject *) _PyStack_AsDict(
PyObject **values,
PyObject *kwnames);
-/* Convert (args, nargs, kwargs: dict) into a (stack, nargs, kwnames: tuple).
-
- Return 0 on success, raise an exception and return -1 on error.
-
- Write the new stack into *p_stack. If *p_stack is differen than args, it
- must be released by PyMem_Free().
+/* Convert FASTCALL (stack, nargs, kwnames) arguments
+ to (args: tuple, kwargs: dict) format.
- The stack uses borrowed references.
+ Return 0 on success. Raise an exception and return -1 on error.
- The type of keyword keys is not checked, these checks should be done
- later (ex: _PyArg_ParseStackAndKeywords). */
-PyAPI_FUNC(int) _PyStack_UnpackDict(
- PyObject **args,
+ The function combines _PyStack_AsTuple() and _PyStack_AsDict(). */
+PyAPI_FUNC(int) _PyStack_AsTupleAndDict(
+ PyObject **stack,
Py_ssize_t nargs,
- PyObject *kwargs,
- PyObject ***p_stack,
- PyObject **p_kwnames);
+ PyObject *kwnames,
+ PyObject **p_args,
+ PyObject **p_kwargs);
/* Suggested size (number of positional arguments) for arrays of PyObject*
allocated on a C stack to avoid allocating memory on the heap memory. Such
@@ -257,12 +252,34 @@ PyAPI_FUNC(PyObject *) _PyObject_Call_Pr
PyObject *args,
PyObject *kwargs);
+PyAPI_FUNC(PyObject *) _PyObject_FastCall_Prepend(PyObject *func,
+ PyObject *obj,
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwnames);
+
+PyAPI_FUNC(int) _PyStack_UnpackDict(PyObject **args, Py_ssize_t nargs,
+ PyObject *kwargs,
+ PyObject ***p_stack, PyObject **p_kwnames);
+
PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *callable,
PyObject *result,
const char *where);
#endif /* Py_LIMITED_API */
+#ifdef Py_BUILD_CORE
+/* Low-level function to call a C function using FASTCALL calling convention.
+ Don't check the result: the caller must check _Py_CheckFunctionResult(). */
+PyAPI_FUNC(PyObject *) _Py_RawFastCallDict(
+ PyObject *self,
+ fastternaryfunc fastcall,
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwargs);
+#endif
+
+
/* Call a callable Python object 'callable', with arguments given by the
tuple 'args'. If no arguments are needed, then 'args' can be *NULL*.
« no previous file with comments | « no previous file | Include/descrobject.h » ('j') | Objects/abstract.c » ('J')

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