summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-10-07 09:47:21 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-10-07 09:47:21 (GMT)
commit5e40e74bbe77c0f9a2bc16ed19b5a2c83345c960 (patch)
tree77e1cbbe9ec5af5f97c0fbdfa82bf7a130ef7b7a /Python/pystate.c
parentddd3f0ea7bba0a55d4da05d2bb29e4394b5e03c0 (diff)
downloadcpython-5e40e74bbe77c0f9a2bc16ed19b5a2c83345c960.zip
cpython-5e40e74bbe77c0f9a2bc16ed19b5a2c83345c960.tar.gz
cpython-5e40e74bbe77c0f9a2bc16ed19b5a2c83345c960.tar.bz2
This is Armin Rigo's patch:
[ 617309 ] getframe hook (Psyco #1) Forward port candidate.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 9a41ccf..faf55f1 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 *
@@ -114,10 +115,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;