py/persistentcode: Use MP_REGISTER_ROOT_POINTER().

This uses MP_REGISTER_ROOT_POINTER() to register track_reloc_code_list
instead of using a conditional inside of mp_state_vm_t.

Signed-off-by: David Lechner <david@pybricks.com>
This commit is contained in:
David Lechner
2022-07-02 15:05:41 -05:00
committed by Damien George
parent 2c728c5330
commit a98aa66df6
2 changed files with 5 additions and 5 deletions

View File

@@ -184,11 +184,6 @@ typedef struct _mp_state_vm_t {
mp_obj_dict_t *mp_module_builtins_override_dict;
#endif
#if MICROPY_PERSISTENT_CODE_TRACK_RELOC_CODE
// An mp_obj_list_t that tracks relocated native code to prevent the GC from reclaiming them.
mp_obj_t track_reloc_code_list;
#endif
// Include any root pointers registered with MP_REGISTER_ROOT_POINTER().
#ifndef NO_QSTR
// Only include root pointer definitions when not doing qstr extraction, because