summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-03-28 01:14:45 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-04-03 00:26:47 +0300
commit7f1c98177bb27a45886fd7e42aa72bef9b1e4a0f (patch)
tree915706975a238a9944cdc45f4bd944bd201580bd /py/mpconfig.h
parentf0a8f2119066943553ba2dc1f27a402ad5ef0a7b (diff)
vm: Support strict stackless mode, with proper exception reporting.
I.e. in this mode, C stack will never be used to call a Python function, but if there's no free heap for a call, it will be reported as RuntimeError (as expected), not MemoryError.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 94e2737de..d561f8079 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -125,11 +125,19 @@
#define MICROPY_QSTR_BYTES_IN_LEN (1)
#endif
-// Avoid using C stack when making Python function calls.
+// Avoid using C stack when making Python function calls. C stack still
+// may be used if there's no free heap.
#ifndef MICROPY_STACKLESS
#define MICROPY_STACKLESS (0)
#endif
+// Never use C stack when making Python function calls. This may break
+// testsuite as will subtly change which exception is thrown in case
+// of too deep recursion and other similar cases.
+#ifndef MICROPY_STACKLESS_STRICT
+#define MICROPY_STACKLESS_STRICT (0)
+#endif
+
/*****************************************************************************/
/* Micro Python emitters */