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

low on stackspace.
This commit is contained in:
Jack Jansen 1996-07-22 15:25:10 +00:00
parent 98bfad75ac
commit 1ed9529a68
1 changed files with 14 additions and 0 deletions

View File

@ -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)