py: Put mp_sys_path, mp_sys_argv and gc_collected in mp_state_ctx_t.

Without mp_sys_path and mp_sys_argv in the root pointer section of the
state, their memory was being incorrectly collected by GC.
This commit is contained in:
Damien George
2015-02-07 17:24:10 +00:00
parent 8785645a95
commit e1e359ff59
5 changed files with 17 additions and 21 deletions

View File

@@ -39,7 +39,7 @@ extern uint gc_collected;
STATIC mp_obj_t py_gc_collect(void) {
gc_collect();
#if MICROPY_PY_GC_COLLECT_RETVAL
return MP_OBJ_NEW_SMALL_INT(gc_collected);
return MP_OBJ_NEW_SMALL_INT(MP_STATE_MEM(gc_collected));
#else
return mp_const_none;
#endif