[Python-3000-checkins] r57679 - python/branches/py3k/Python/marshal.c

guido.van.rossum python-3000-checkins at python.org
Wed Aug 29 22:39:13 CEST 2007


Author: guido.van.rossum
Date: Wed Aug 29 22:39:13 2007
New Revision: 57679

Modified:
   python/branches/py3k/Python/marshal.c
Log:
[Oops, I forgot half of the patch.]
Patch # 1050 by Amaury Forgeot d'Arc.
On Windows, debug builds insert stack probes, and recursive functions
tend to exhaust the stack faster.
This patch reduces the marshal maximum depth from 2000 to 1500 for debug
builds only. Optimized builds are not affected.
This allows test_marshal to pass with debug builds.


Modified: python/branches/py3k/Python/marshal.c
==============================================================================
--- python/branches/py3k/Python/marshal.c	(original)
+++ python/branches/py3k/Python/marshal.c	Wed Aug 29 22:39:13 2007
@@ -14,8 +14,13 @@
 /* High water mark to determine when the marshalled object is dangerously deep
  * and risks coring the interpreter.  When the object stack gets this deep,
  * raise an exception instead of continuing.
+ * On Windows debug builds, reduce this value.
  */
+#if defined(MS_WINDOWS) && defined(_DEBUG)
+#define MAX_MARSHAL_STACK_DEPTH 1500
+#else
 #define MAX_MARSHAL_STACK_DEPTH 2000
+#endif
 
 #define TYPE_NULL		'0'
 #define TYPE_NONE		'N'


More information about the Python-3000-checkins mailing list