diff options
author | Michael W. Hudson <mwh@python.net> | 2002-11-08 12:53:11 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-11-08 12:53:11 (GMT) |
commit | 019a78e76d3542d4d56a08015e6980f8c8aeaba1 (patch) | |
tree | 33e0d463374c7f48218a94738d7e964d4e5f0a46 /Python/pystate.c | |
parent | 1f04610b497c733189212386152219040e18dacb (diff) | |
download | cpython-019a78e76d3542d4d56a08015e6980f8c8aeaba1.zip cpython-019a78e76d3542d4d56a08015e6980f8c8aeaba1.tar.gz cpython-019a78e76d3542d4d56a08015e6980f8c8aeaba1.tar.bz2 |
Assorted patches from Armin Rigo:
[ 617309 ] getframe hook (Psyco #1)
[ 617311 ] Tiny profiling info (Psyco #2)
[ 617312 ] debugger-controlled jumps (Psyco #3)
These are forward ports from 2.2.2.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index ad92dde..707e43e 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -35,6 +35,7 @@ static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */ static PyInterpreterState *interp_head = NULL; PyThreadState *_PyThreadState_Current = NULL; +unaryfunc _PyThreadState_GetFrame = NULL; PyInterpreterState * @@ -113,10 +114,19 @@ PyInterpreterState_Delete(PyInterpreterState *interp) } +/* Default implementation for _PyThreadState_GetFrame */ +static struct _frame * +threadstate_getframe(PyThreadState *self) +{ + return self->frame; +} + PyThreadState * PyThreadState_New(PyInterpreterState *interp) { PyThreadState *tstate = PyMem_NEW(PyThreadState, 1); + if (_PyThreadState_GetFrame == NULL) + _PyThreadState_GetFrame = (unaryfunc)threadstate_getframe; if (tstate != NULL) { tstate->interp = interp; @@ -125,6 +135,7 @@ PyThreadState_New(PyInterpreterState *interp) tstate->recursion_depth = 0; tstate->tracing = 0; tstate->use_tracing = 0; + tstate->tick_counter = 0; tstate->dict = NULL; |