diff options
author | Damien George <damien.p.george@gmail.com> | 2015-02-07 17:24:10 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-02-07 17:24:10 +0000 |
commit | e1e359ff59d6bbf09441cc1f3965be63f1046182 (patch) | |
tree | c7c05b27f535ebf52fe52fcea9e7fb0b07f18e28 /py/modgc.c | |
parent | 8785645a952c03315dbf93667b5f7c7eec49762f (diff) |
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.
Diffstat (limited to 'py/modgc.c')
-rw-r--r-- | py/modgc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/modgc.c b/py/modgc.c index 38f7c15fe..47980deca 100644 --- a/py/modgc.c +++ b/py/modgc.c @@ -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 |