summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Bastin <nick.bastin@gmail.com>2004-06-22 15:37:51 (GMT)
committerNicholas Bastin <nick.bastin@gmail.com>2004-06-22 15:37:51 (GMT)
commit941b8bc41acd4bfbc52a5cfb28054bdc37a05ca5 (patch)
tree17772d941984c387514348c9ffe5de731aa9df14
parentbbffbd19836b163b679f950a4977cb9b451c14ea (diff)
downloadcpython-941b8bc41acd4bfbc52a5cfb28054bdc37a05ca5.zip
cpython-941b8bc41acd4bfbc52a5cfb28054bdc37a05ca5.tar.gz
cpython-941b8bc41acd4bfbc52a5cfb28054bdc37a05ca5.tar.bz2
Less ugly #ifdefs for C profiling fix
-rw-r--r--Python/ceval.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 6bc35d0..6f6fef6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3438,6 +3438,7 @@ err_args(PyObject *func, int flags, int nargs)
nargs);
}
+#ifdef WITH_C_PROF
#define BEGIN_C_TRACE \
if (tstate->use_tracing) { \
if (tstate->c_profilefunc != NULL) { \
@@ -3472,6 +3473,10 @@ if (tstate->use_tracing) { \
} \
} \
}
+#else
+#define BEGIN_C_TRACE
+#define END_C_TRACE
+#endif
static PyObject *
@@ -3503,23 +3508,15 @@ call_function(PyObject ***pp_stack, int oparg
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
PyObject *self = PyCFunction_GET_SELF(func);
if (flags & METH_NOARGS && na == 0) {
-#ifdef WITH_C_PROF
BEGIN_C_TRACE
-#endif
x = (*meth)(self, NULL);
-#ifdef WITH_C_PROF
END_C_TRACE
-#endif
}
else if (flags & METH_O && na == 1) {
PyObject *arg = EXT_POP(*pp_stack);
-#ifdef WITH_C_PROF
BEGIN_C_TRACE
-#endif
x = (*meth)(self, arg);
-#ifdef WITH_C_PROF
END_C_TRACE
-#endif
Py_DECREF(arg);
}
else {
@@ -3530,9 +3527,7 @@ call_function(PyObject ***pp_stack, int oparg
else {
PyObject *callargs;
callargs = load_args(pp_stack, na);
-#ifdef WITH_C_PROF
BEGIN_C_TRACE
-#endif
#ifdef WITH_TSC
rdtscll(*pintr0);
#endif
@@ -3540,9 +3535,7 @@ call_function(PyObject ***pp_stack, int oparg
#ifdef WITH_TSC
rdtscll(*pintr1);
#endif
-#ifdef WITH_C_PROF
END_C_TRACE
-#endif
Py_XDECREF(callargs);
}
} else {