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)). --- windows/mpconfigport.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'windows') diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index 80166f149..ad79ef381 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -178,6 +178,10 @@ extern const struct _mp_obj_module_t mp_module_time; #include "init.h" #include "sleep.h" +#ifdef __GNUC__ +#define MP_NOINLINE __attribute__((noinline)) +#endif + // MSVC specifics #ifdef _MSC_VER @@ -191,6 +195,7 @@ extern const struct _mp_obj_module_t mp_module_time; // CL specific overrides from mpconfig #define NORETURN __declspec(noreturn) +#define MP_NOINLINE __declspec(noinline) #define MP_LIKELY(x) (x) #define MP_UNLIKELY(x) (x) #define MICROPY_PORT_CONSTANTS { "dummy", 0 } //can't have zero-sized array -- cgit v1.2.3