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

Unified Diff: Objects/weakrefobject.c

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
--- a/Objects/weakrefobject.c Wed Jan 25 23:33:27 2017 +0100
+++ b/Objects/weakrefobject.c Thu Jan 26 02:43:18 2017 +0100
@@ -461,7 +461,15 @@ proxy_checkref(PyWeakReference *proxy)
WRAP_BINARY(proxy_getattr, PyObject_GetAttr)
WRAP_UNARY(proxy_str, PyObject_Str)
-WRAP_TERNARY(proxy_call, PyEval_CallObjectWithKeywords)
+
+static PyObject *
+proxy_call(PyObject *proxy, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
+{
+ UNWRAP(proxy);
+ return _PyObject_FastCallKeywords(proxy, args, nargs, kwnames);
+}
+
static PyObject *
proxy_repr(PyWeakReference *proxy)
@@ -711,7 +719,7 @@ PyTypeObject
&proxy_as_sequence, /* tp_as_sequence */
&proxy_as_mapping, /* tp_as_mapping */
0, /* tp_hash */
- proxy_call, /* tp_call */
+ 0, /* tp_call */
proxy_str, /* tp_str */
proxy_getattr, /* tp_getattro */
(setattrofunc)proxy_setattr, /* tp_setattro */
@@ -724,6 +732,8 @@ PyTypeObject
0, /* tp_weaklistoffset */
(getiterfunc)proxy_iter, /* tp_iter */
(iternextfunc)proxy_iternext, /* tp_iternext */
+
+ .tp_fastcall = (fastternaryfunc)proxy_call,
};
« Objects/typeobject.c ('K') | « Objects/typeobject.c ('k') | Tools/gdb/libpython.py » ('j') | no next file with comments »

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