Skip to content

Commit 4a5895c

Browse files
committed
py: Disable stack checking by default; enable on most ports.
1 parent 85e8e2e commit 4a5895c

7 files changed

Lines changed: 6 additions & 3 deletions

File tree

bare-arm/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "py/parsehelper.h"
77
#include "py/compile.h"
88
#include "py/runtime.h"
9-
#include "py/stackctrl.h"
109
#include "py/repl.h"
1110
#include "py/pfenv.h"
1211

@@ -48,7 +47,6 @@ void do_str(const char *src) {
4847
}
4948

5049
int main(int argc, char **argv) {
51-
mp_stack_set_limit(10240);
5250
mp_init();
5351
do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\n')");
5452
mp_deinit();

esp8266/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define MICROPY_MEM_STATS (0)
1010
#define MICROPY_DEBUG_PRINTERS (0)
1111
#define MICROPY_ENABLE_GC (1)
12+
#define MICROPY_STACK_CHECK (1)
1213
#define MICROPY_HELPER_REPL (1)
1314
#define MICROPY_HELPER_LEXER_UNIX (0)
1415
#define MICROPY_ENABLE_SOURCE_LINE (1)

py/mpconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
// Whether to check C stack usage. C stack used for calling Python functions,
206206
// etc. Not checking means segfault on overflow.
207207
#ifndef MICROPY_STACK_CHECK
208-
#define MICROPY_STACK_CHECK (1)
208+
#define MICROPY_STACK_CHECK (0)
209209
#endif
210210

211211
// Whether to have an emergency exception buffer

qemu-arm/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define MICROPY_MEM_STATS (0)
1010
#define MICROPY_DEBUG_PRINTERS (0)
1111
#define MICROPY_ENABLE_GC (0)
12+
#define MICROPY_STACK_CHECK (1)
1213
#define MICROPY_HELPER_REPL (0)
1314
#define MICROPY_HELPER_LEXER_UNIX (0)
1415
#define MICROPY_ENABLE_SOURCE_LINE (0)

stmhal/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#define MICROPY_EMIT_INLINE_THUMB (1)
3636
#define MICROPY_ENABLE_GC (1)
3737
#define MICROPY_ENABLE_FINALISER (1)
38+
#define MICROPY_STACK_CHECK (1)
3839
#define MICROPY_HELPER_REPL (1)
3940
#define MICROPY_ENABLE_SOURCE_LINE (1)
4041
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)

teensy/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define MICROPY_EMIT_INLINE_THUMB (1)
88
#define MICROPY_ENABLE_GC (1)
99
#define MICROPY_ENABLE_FINALISER (1)
10+
#define MICROPY_STACK_CHECK (1)
1011
#define MICROPY_HELPER_REPL (1)
1112
#define MICROPY_ENABLE_SOURCE_LINE (1)
1213
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)

unix/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#endif
4242
#define MICROPY_ENABLE_GC (1)
4343
#define MICROPY_ENABLE_FINALISER (1)
44+
#define MICROPY_STACK_CHECK (1)
4445
#define MICROPY_MEM_STATS (1)
4546
#define MICROPY_DEBUG_PRINTERS (1)
4647
#define MICROPY_HELPER_REPL (1)

0 commit comments

Comments
 (0)