diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-07-22 15:25:10 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-07-22 15:25:10 (GMT) |
commit | 1ed9529a68bd28442a30b93f455d9575b05123cd (patch) | |
tree | 8edd4211802136e37d55b1495acaccbaa300f35e /Mac | |
parent | 98bfad75ac5a340bcb9d88069546646357b9e5ad (diff) | |
download | cpython-1ed9529a68bd28442a30b93f455d9575b05123cd.zip cpython-1ed9529a68bd28442a30b93f455d9575b05123cd.tar.gz cpython-1ed9529a68bd28442a30b93f455d9575b05123cd.tar.bz2 |
Added PyOS_CheckStack() function which returns -1 when we are running
low on stackspace.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Python/macglue.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index 74fa2ee..e0cbd1a 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -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) |