From d3b1f0b627ccc6705d9fe958549badb87a74ded1 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 29 Jan 2016 01:05:53 +0200 Subject: py/runtime: mp_stack_ctrl_init() should be called immediately on startup. Calling it from mp_init() is too late for some ports (like Unix), and leads to incomplete stack frame being captured, with following GC issues. So, now each port should call mp_stack_ctrl_init() on its own, ASAP after startup, and taking special precautions so it really was called before stack variables get allocated (because if such variable with a pointer is missed, it may lead to over-collecting (typical symptom is segfaulting)). --- teensy/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'teensy/main.c') diff --git a/teensy/main.c b/teensy/main.c index b630e8886..41e445cb5 100644 --- a/teensy/main.c +++ b/teensy/main.c @@ -253,6 +253,7 @@ int main(void) { #define SCB_CCR_STKALIGN (1 << 9) SCB_CCR |= SCB_CCR_STKALIGN; + mp_stack_ctrl_init(); mp_stack_set_limit(10240); pinMode(LED_BUILTIN, OUTPUT); -- cgit v1.2.3