summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2005-06-25 07:07:35 (GMT)
committerBrett Cannon <bcannon@gmail.com>2005-06-25 07:07:35 (GMT)
commit55fa66dd45e76a57deca8cebaedf1a624499648b (patch)
treef25a0a1b1939d8b0b2033e932411e3bac05155cd /Python/ceval.c
parent527c46996f3c78124c6c7691594fa36ded24719d (diff)
downloadcpython-55fa66dd45e76a57deca8cebaedf1a624499648b.zip
cpython-55fa66dd45e76a57deca8cebaedf1a624499648b.tar.gz
cpython-55fa66dd45e76a57deca8cebaedf1a624499648b.tar.bz2
Add comments about PyThreadState and the usage of its fields.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 459fd0d..972061d 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3284,10 +3284,12 @@ PyEval_SetProfile(Py_tracefunc func, PyObject *arg)
Py_XINCREF(arg);
tstate->c_profilefunc = NULL;
tstate->c_profileobj = NULL;
+ /* Must make sure that tracing is not ignored if 'temp' is freed */
tstate->use_tracing = tstate->c_tracefunc != NULL;
Py_XDECREF(temp);
tstate->c_profilefunc = func;
tstate->c_profileobj = arg;
+ /* Flag that tracing or profiling is turned on */
tstate->use_tracing = (func != NULL) || (tstate->c_tracefunc != NULL);
}
@@ -3299,10 +3301,12 @@ PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
Py_XINCREF(arg);
tstate->c_tracefunc = NULL;
tstate->c_traceobj = NULL;
+ /* Must make sure that profiling is not ignored if 'temp' is freed */
tstate->use_tracing = tstate->c_profilefunc != NULL;
Py_XDECREF(temp);
tstate->c_tracefunc = func;
tstate->c_traceobj = arg;
+ /* Flag that tracing or profiling is turned on */
tstate->use_tracing = ((func != NULL)
|| (tstate->c_profilefunc != NULL));
}