| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#include <src/precommondefs.h> |
| 6 |
|
| 7 |
|
| 8 |
#ifndef MAX_STACK_SIZE |
| 9 |
# if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
# define MAX_STACK_SIZE (11 << 18) |
| 14 |
# elif defined(__s390x__) |
| 15 |
|
| 16 |
# define MAX_STACK_SIZE (11 << 18) |
| 17 |
# else |
| 18 |
# define MAX_STACK_SIZE (3 << 18) |
| 19 |
# endif |
| 20 |
#endif |
| 21 |
|
| 22 |
|
| 23 |
typedef struct { |
| 24 |
char *stack_end; |
| 25 |
Signed stack_length; |
| 26 |
char report_error; |
| 27 |
} rpy_stacktoobig_t; |
| 28 |
|
| 29 |
RPY_EXTERN rpy_stacktoobig_t rpy_stacktoobig; |
| 30 |
|
| 31 |
RPY_EXTERN |
| 32 |
char LL_stack_too_big_slowpath(Signed); |
| 33 |
RPY_EXTERN |
| 34 |
void LL_stack_set_length_fraction(double); |
| 35 |
|
| 36 |
|
| 37 |
#define LL_stack_get_end() ((Signed)rpy_stacktoobig.stack_end) |
| 38 |
#define LL_stack_get_length() rpy_stacktoobig.stack_length |
| 39 |
#define LL_stack_get_end_adr() ((Signed)&rpy_stacktoobig.stack_end) |
| 40 |
#define LL_stack_get_length_adr() ((Signed)&rpy_stacktoobig.stack_length) |
| 41 |
|
| 42 |
#define LL_stack_criticalcode_start() (rpy_stacktoobig.report_error = 0) |
| 43 |
#define LL_stack_criticalcode_stop() (rpy_stacktoobig.report_error = 1) |
| 44 |
|
| 45 |
|
| 46 |
#ifdef __GNUC__ |
| 47 |
# define PYPY_INHIBIT_TAIL_CALL() asm("") |
| 48 |
#elif defined(_MSC_VER) && !defined(_WIN64) |
| 49 |
# define PYPY_INHIBIT_TAIL_CALL() __asm NOP |
| 50 |
#else |
| 51 |
# define PYPY_INHIBIT_TAIL_CALL() |
| 52 |
#endif |