summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-01 14:43:22 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-12-01 14:43:22 +0100
commit366f4ee4da4420842eac26b3fa00c2b01d4515a6 (patch)
treeaf04812c0c76b5d16714e955471ae16e80307902 /Python/sysmodule.c
parentcbd0371d81fc46a7a9353ce362ec85ee45ce354b (diff)
downloadcpython-366f4ee4da4420842eac26b3fa00c2b01d4515a6.tar.gz
Replace PyObject_CallFunctionObjArgs() with fastcall
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 79068304ab..2a3f36c6dd 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1098,7 +1098,7 @@ _PySys_GetSizeOf(PyObject *o)
Py_TYPE(o)->tp_name);
}
else {
- res = PyObject_CallFunctionObjArgs(method, NULL);
+ res = _PyObject_CallNoArg(method);
Py_DECREF(method);
}