diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-25 03:03:34 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-27 00:03:55 +0300 |
commit | 23668698cba9bf861c697e65e3d07f9433396b8b (patch) | |
tree | 7b87345f47610c70e7b5a3559b387e822936573e /py/mpconfig.h | |
parent | 91b576d1472b481f02a9f9f20dd263ef606a186a (diff) | |
download | micropython-23668698cba9bf861c697e65e3d07f9433396b8b.tar.gz micropython-23668698cba9bf861c697e65e3d07f9433396b8b.zip |
py: Add portable framework to query/check C stack usage.
Such mechanism is important to get stable Python functioning, because Python
function calling is handled with C stack. The idea is to sprinkle
STACK_CHECK() calls in places where there can be C recursion.
TODO: Add more STACK_CHECK()'s.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 4a3288a3d1..d7504c1402 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -157,6 +157,12 @@ #define MICROPY_ENABLE_GC_FINALISER (0) #endif +// Whether to check C stack usage. C stack used for calling Python functions, +// etc. Not checking means segfault on overflow. +#ifndef MICROPY_STACK_CHECK +#define MICROPY_STACK_CHECK (1) +#endif + // Whether to include REPL helper function #ifndef MICROPY_HELPER_REPL #define MICROPY_HELPER_REPL (0) |