Commit 7b736b2b authored by Jack Jansen's avatar Jack Jansen

Added PyOS_CheckStack() function which returns -1 when we are running

low on stackspace.
parent 70bfae4c
......@@ -225,6 +225,20 @@ PyMac_Error(OSErr err)
return PyErr_Mac(PyMac_GetOSErrException(), err);
}
#ifdef USE_STACKCHECK
/* Check for stack overflow */
int
PyOS_CheckStack()
{
long left;
left = StackSpace();
if ( left < 4000 )
return -1;
return 0;
}
#endif /* USE_STACKCHECK */
/* The catcher routine (which may not be used for all compilers) */
static RETSIGTYPE
intcatcher(sig)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment