Lowered the recursion limit on compares to 60 (one recursion depth can
take a whopping 2K of stack space when running test_b1!)
/* Generic object operations; and implementation of None (NoObject) */
#include "Python.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
#ifdef macintosh
#include "macglue.h"
some types) and decremented on exit. If the count exceeds the
nesting limit, enable code to detect circular data structures.
*/
+#ifdef macintosh
+#define NESTING_LIMIT 60
+#else
#define NESTING_LIMIT 500
+#endif
int _PyCompareState_nesting = 0;
static PyObject*
PyTypeObject *vtp, *wtp;
int result;
+#if defined(USE_STACKCHECK)
+ if (PyOS_CheckStack() < 0) {
+ PyErr_SetString(PyExc_MemoryError, "Stack overflow");
+ return -1;
+ }
+#endif
if (v == NULL || w == NULL) {
PyErr_BadInternalCall();
return -1;