mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
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)).
This commit is contained in:
@@ -61,7 +61,6 @@ const mp_obj_module_t mp_module___main__ = {
|
||||
|
||||
void mp_init(void) {
|
||||
qstr_init();
|
||||
mp_stack_ctrl_init();
|
||||
|
||||
// no pending exceptions to start with
|
||||
MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
|
||||
|
||||
Reference in New Issue
Block a user