diff Mac/Python/macglue.c @ 3786:718c8af7be2a legacy-trunk

Added PyOS_CheckStack() function which returns -1 when we are running low on stackspace.
author Jack Jansen <jack.jansen@cwi.nl>
date Mon, 22 Jul 1996 15:25:10 +0000
parents f89fa7e95b84
children 524cf501c851
line wrap: on
line diff
--- a/Mac/Python/macglue.c	Mon Jul 22 15:23:58 1996 +0000
+++ b/Mac/Python/macglue.c	Mon Jul 22 15:25:10 1996 +0000
@@ -225,6 +225,20 @@
 	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)