Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(98)

Side by Side Diff: Python/marshal.c

Issue 22734: marshal needs a lower stack depth for debug builds on Windows
Patch Set: Created 5 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_marshal.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Write Python objects to files and read them back. 2 /* Write Python objects to files and read them back.
3 This is primarily intended for writing and reading compiled Python code, 3 This is primarily intended for writing and reading compiled Python code,
4 even though dicts, lists, sets and frozensets, not commonly seen in 4 even though dicts, lists, sets and frozensets, not commonly seen in
5 code objects, are supported. 5 code objects, are supported.
6 Version 3 of this protocol properly supports circular links 6 Version 3 of this protocol properly supports circular links
7 and sharing. */ 7 and sharing. */
8 8
9 #define PY_SSIZE_T_CLEAN 9 #define PY_SSIZE_T_CLEAN
10 10
11 #include "Python.h" 11 #include "Python.h"
12 #include "longintrepr.h" 12 #include "longintrepr.h"
13 #include "code.h" 13 #include "code.h"
14 #include "marshal.h" 14 #include "marshal.h"
15 15
16 /* High water mark to determine when the marshalled object is dangerously deep 16 /* High water mark to determine when the marshalled object is dangerously deep
17 * and risks coring the interpreter. When the object stack gets this deep, 17 * and risks coring the interpreter. When the object stack gets this deep,
18 * raise an exception instead of continuing. 18 * raise an exception instead of continuing.
19 * On Windows debug builds, reduce this value. 19 * On Windows debug builds, reduce this value.
20 */ 20 */
21 #if defined(MS_WINDOWS) && defined(_DEBUG) 21 #if defined(MS_WINDOWS) && defined(_DEBUG)
22 #define MAX_MARSHAL_STACK_DEPTH 1500 22 #define MAX_MARSHAL_STACK_DEPTH 1000
23 #else 23 #else
24 #define MAX_MARSHAL_STACK_DEPTH 2000 24 #define MAX_MARSHAL_STACK_DEPTH 2000
25 #endif 25 #endif
26 26
27 #define TYPE_NULL '0' 27 #define TYPE_NULL '0'
28 #define TYPE_NONE 'N' 28 #define TYPE_NONE 'N'
29 #define TYPE_FALSE 'F' 29 #define TYPE_FALSE 'F'
30 #define TYPE_TRUE 'T' 30 #define TYPE_TRUE 'T'
31 #define TYPE_STOPITER 'S' 31 #define TYPE_STOPITER 'S'
32 #define TYPE_ELLIPSIS '.' 32 #define TYPE_ELLIPSIS '.'
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 1748
1749 PyMODINIT_FUNC 1749 PyMODINIT_FUNC
1750 PyMarshal_Init(void) 1750 PyMarshal_Init(void)
1751 { 1751 {
1752 PyObject *mod = PyModule_Create(&marshalmodule); 1752 PyObject *mod = PyModule_Create(&marshalmodule);
1753 if (mod == NULL) 1753 if (mod == NULL)
1754 return NULL; 1754 return NULL;
1755 PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION); 1755 PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
1756 return mod; 1756 return mod;
1757 } 1757 }
OLDNEW
« no previous file with comments | « Lib/test/test_marshal.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+