Commit Graph

16 Commits

Author SHA1 Message Date
Dan Halbert 5d509ecace Allow max stack checking to be used with -flto build by determining top
of stack in a different way.
2017-08-05 17:48:16 -07:00
Dan Halbert f91493c97e Measure and report maximum stack usage. (#175)
Add max stack usage tracking, visible via debug module ustack.
Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
2017-07-23 15:32:05 -04:00
Scott Shawcroft 03a7069d60 py: Change asm form to make minimal port happy. 2017-06-20 17:52:13 -07:00
Dan Halbert 88b449a8cd Fix broken mp_stack_check: force mp_stack_ctrl_init() and mp_stack_usage() not to be inlined even with -flto 2017-06-04 22:05:55 -04:00
Scott Shawcroft 3fd19c60cc py: Fix recursion exception. 2017-02-24 17:47:25 +01:00
Scott Shawcroft 12fa5b3a66 Switch exception throwing to mp_raise helpers. It saves a little code space each time to share the call. 2017-02-24 15:13:07 +01:00
Damien George 330165a2cc py: Add MP_STATE_THREAD to hold state specific to a given thread. 2016-06-28 11:09:31 +01:00
Paul Sokolovsky 1d5d4f49d9 py/stackctrl: Add mp_stack_set_top() to explicitly set stack top value.
Useful for embedded targets with fixed stack layout.
2016-03-07 14:12:24 +07:00
Paul Sokolovsky 7f1c98177b 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.
2015-04-03 00:26:47 +03:00
Paul Sokolovsky e8432b3c72 stackctrl: Encode "recursion depth exceeded" message as qstr.
So corresponding exception can be thrown even under tight memory conditions.
2015-02-15 22:41:14 +03:00
Damien George b4b10fd350 py: Put all global state together in state structures.
This patch consolidates all global variables in py/ core into one place,
in a global structure.  Root pointers are all located together to make
GC tracing easier and more efficient.
2015-01-07 20:33:00 +00:00
Damien George 51dfcb4bb7 py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022.
2015-01-01 20:32:09 +00:00
Damien George b4fe6e28eb py: Fix function type: () -> (void). 2014-12-10 18:05:42 +00:00
Damien George 4abff7500f py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.
Part of code cleanup, working towards resolving issue #50.
2014-08-30 14:59:21 +01:00
Paul Sokolovsky caa7334141 stackctrl: Add "mp_" prefix. 2014-07-01 02:14:08 +03:00
Paul Sokolovsky 23668698cb 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.
2014-06-27 00:03:55 +03:00