File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,4 +286,24 @@ const mp_obj_module_t mp_module_sys = {
286286
287287MP_REGISTER_MODULE (MP_QSTR_usys , mp_module_sys );
288288
289+ // If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is not enabled then these two lists
290+ // must be initialised after the call to mp_init.
291+ MP_REGISTER_ROOT_POINTER (mp_obj_list_t mp_sys_path_obj );
292+ MP_REGISTER_ROOT_POINTER (mp_obj_list_t mp_sys_argv_obj );
293+
294+ #if MICROPY_PY_SYS_EXC_INFO
295+ // current exception being handled, for sys.exc_info()
296+ MP_REGISTER_ROOT_POINTER (mp_obj_base_t * cur_exception );
297+ #endif
298+
299+ #if MICROPY_PY_SYS_ATEXIT
300+ // exposed through sys.atexit function
301+ MP_REGISTER_ROOT_POINTER (mp_obj_t sys_exitfunc );
289302#endif
303+
304+ #if MICROPY_PY_SYS_ATTR_DELEGATION
305+ // Contains mutable sys attributes.
306+ MP_REGISTER_ROOT_POINTER (mp_obj_t sys_mutable [MP_SYS_MUTABLE_NUM ]);
307+ #endif
308+
309+ #endif // MICROPY_PY_SYS
Original file line number Diff line number Diff line change @@ -154,31 +154,9 @@ typedef struct _mp_state_vm_t {
154154 mp_sched_item_t sched_queue [MICROPY_SCHEDULER_DEPTH ];
155155 #endif
156156
157- // current exception being handled, for sys.exc_info()
158- #if MICROPY_PY_SYS_EXC_INFO
159- mp_obj_base_t * cur_exception ;
160- #endif
161-
162- #if MICROPY_PY_SYS_ATEXIT
163- // exposed through sys.atexit function
164- mp_obj_t sys_exitfunc ;
165- #endif
166-
167157 // dictionary for the __main__ module
168158 mp_obj_dict_t dict_main ;
169159
170- #if MICROPY_PY_SYS
171- // If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is not enabled then these two lists
172- // must be initialised after the call to mp_init.
173- mp_obj_list_t mp_sys_path_obj ;
174- mp_obj_list_t mp_sys_argv_obj ;
175-
176- #if MICROPY_PY_SYS_ATTR_DELEGATION
177- // Contains mutable sys attributes.
178- mp_obj_t sys_mutable [MP_SYS_MUTABLE_NUM ];
179- #endif
180- #endif
181-
182160 // dictionary for overridden builtins
183161 #if MICROPY_CAN_OVERRIDE_BUILTINS
184162 mp_obj_dict_t * mp_module_builtins_override_dict ;
You can’t perform that action at this time.
0 commit comments