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

Side by Side Diff: Python/marshal.c

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 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 | « Python/importlib_external.h ('k') | Tools/iOS-test/app/iOS-test/main.py » ('j') | 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 #include "../Modules/hashtable.h" 15 #include "../Modules/hashtable.h"
16 16
17 #ifdef __APPLE__
18 # include "TargetConditionals.h"
19 #endif /* __APPLE__ */
20
17 /* High water mark to determine when the marshalled object is dangerously deep 21 /* High water mark to determine when the marshalled object is dangerously deep
18 * and risks coring the interpreter. When the object stack gets this deep, 22 * and risks coring the interpreter. When the object stack gets this deep,
19 * raise an exception instead of continuing. 23 * raise an exception instead of continuing.
20 * On Windows debug builds, reduce this value. 24 * On Windows debug builds, reduce this value.
25 * iOS also requires a reduced value.
21 */ 26 */
22 #if defined(MS_WINDOWS) && defined(_DEBUG) 27 #if defined(MS_WINDOWS) && defined(_DEBUG)
23 #define MAX_MARSHAL_STACK_DEPTH 1000 28 #define MAX_MARSHAL_STACK_DEPTH 1000
29 #elif TARGET_OS_IPHONE
30 #define MAX_MARSHAL_STACK_DEPTH 1500
24 #else 31 #else
25 #define MAX_MARSHAL_STACK_DEPTH 2000 32 #define MAX_MARSHAL_STACK_DEPTH 2000
26 #endif 33 #endif
27 34
28 #define TYPE_NULL '0' 35 #define TYPE_NULL '0'
29 #define TYPE_NONE 'N' 36 #define TYPE_NONE 'N'
30 #define TYPE_FALSE 'F' 37 #define TYPE_FALSE 'F'
31 #define TYPE_TRUE 'T' 38 #define TYPE_TRUE 'T'
32 #define TYPE_STOPITER 'S' 39 #define TYPE_STOPITER 'S'
33 #define TYPE_ELLIPSIS '.' 40 #define TYPE_ELLIPSIS '.'
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 1831
1825 PyMODINIT_FUNC 1832 PyMODINIT_FUNC
1826 PyMarshal_Init(void) 1833 PyMarshal_Init(void)
1827 { 1834 {
1828 PyObject *mod = PyModule_Create(&marshalmodule); 1835 PyObject *mod = PyModule_Create(&marshalmodule);
1829 if (mod == NULL) 1836 if (mod == NULL)
1830 return NULL; 1837 return NULL;
1831 PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION); 1838 PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
1832 return mod; 1839 return mod;
1833 } 1840 }
OLDNEW
« no previous file with comments | « Python/importlib_external.h ('k') | Tools/iOS-test/app/iOS-test/main.py » ('j') | no next file with comments »

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