[Python-Dev] USE_STACKCHECK/PyOS_CheckStack

Tim Peters tim_one@email.msn.com
Wed, 5 Jul 2000 21:27:48 -0400


Twice in ceval.c, and once in object.c, there's code referencing
PyOS_CheckStack under the control of the preprocessor symbol USE_STACKCHECK.
There's nothing in the std distribution that could possibly define either of
those names.  Why are they there?  If nobody objects, I'll get rid of this
code!

PS for Jeremy:  the mechanism I was thinking of is _ts.recursion_depth,
which is used cross-platform in ceval.c, like so:

	if (++tstate->recursion_depth > MAX_RECURSION_DEPTH) {
		--tstate->recursion_depth;
		PyErr_SetString(PyExc_RuntimeError,
				"Maximum recursion depth exceeded");
		tstate->frame = f->f_back;
		Py_DECREF(f);
		return NULL;
	}

The effectiveness of this is dependent on guessing a good value (per
platform) for MAX_RECURSION_DEPTH (and it's broken under Windows in 1.5.2).