Debian Codegraph @

Include/internal/pycore_pythonrun.h

raw
1 #ifndef Py_INTERNAL_PYTHONRUN_H
2 #define Py_INTERNAL_PYTHONRUN_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 #ifndef Py_BUILD_CORE
8 # error "this header requires Py_BUILD_CORE define"
9 #endif
10
11 extern int _PyRun_SimpleFileObject(
12 FILE *fp,
13 PyObject *filename,
14 int closeit,
15 PyCompilerFlags *flags);
16
17 extern int _PyRun_AnyFileObject(
18 FILE *fp,
19 PyObject *filename,
20 int closeit,
21 PyCompilerFlags *flags);
22
23 extern int _PyRun_InteractiveLoopObject(
24 FILE *fp,
25 PyObject *filename,
26 PyCompilerFlags *flags);
27
28 extern int _PyObject_SupportedAsScript(PyObject *);
29 extern const char* _Py_SourceAsString(
30 PyObject *cmd,
31 const char *funcname,
32 const char *what,
33 PyCompilerFlags *cf,
34 PyObject **cmd_copy);
35
36
37 /* Stack size, in "pointers". This must be large enough, so
38 * no two calls to check recursion depth are more than this far
39 * apart. In practice, that means it must be larger than the C
40 * stack consumption of PyEval_EvalDefault */
41 #if (defined(Py_DEBUG) \
42 || defined(_Py_ADDRESS_SANITIZER) \
43 || defined(_Py_THREAD_SANITIZER))
44 # define _PyOS_LOG2_STACK_MARGIN 12
45 #else
46 # define _PyOS_LOG2_STACK_MARGIN 11
47 #endif
48 #define _PyOS_STACK_MARGIN (1 << _PyOS_LOG2_STACK_MARGIN)
49 #define _PyOS_STACK_MARGIN_BYTES (_PyOS_STACK_MARGIN * sizeof(void *))
50
51 #if SIZEOF_VOID_P == 8
52 # define _PyOS_STACK_MARGIN_SHIFT (_PyOS_LOG2_STACK_MARGIN + 3)
53 #else
54 # define _PyOS_STACK_MARGIN_SHIFT (_PyOS_LOG2_STACK_MARGIN + 2)
55 #endif
56
57 #ifdef _Py_THREAD_SANITIZER
58 # define _PyOS_MIN_STACK_SIZE (_PyOS_STACK_MARGIN_BYTES * 6)
59 #else
60 # define _PyOS_MIN_STACK_SIZE (_PyOS_STACK_MARGIN_BYTES * 3)
61 #endif
62
63
64 #ifdef __cplusplus
65 }
66 #endif
67 #endif // !Py_INTERNAL_PYTHONRUN_H
68