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:
committed by
Damien George
parent
2c728c5330
commit
a98aa66df6
@@ -644,3 +644,8 @@ void mp_raw_code_save_file(mp_compiled_module_t *cm, const char *filename) {
|
||||
#endif // MICROPY_PERSISTENT_CODE_SAVE_FILE
|
||||
|
||||
#endif // MICROPY_PERSISTENT_CODE_SAVE
|
||||
|
||||
#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_REGISTER_ROOT_POINTER(mp_obj_t track_reloc_code_list);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user