diff options
| author | David Lechner <david@pybricks.com> | 2022-07-02 15:05:41 -0500 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-07-18 13:52:01 +1000 |
| commit | 631b692177ef1e6ba2832ee224e2680ac9982dbf (patch) | |
| tree | b4dccccab5a10512a76d0b2ebdb1a61c28fc1bd4 | |
| parent | 68f46342aa4c20f263cc688cc86d03d03207921e (diff) | |
extmod/uos_dupterm: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register dupterm_objs
instead of using a conditional inside of mp_state_vm_t.
Signed-off-by: David Lechner <david@pybricks.com>
| -rw-r--r-- | extmod/uos_dupterm.c | 4 | ||||
| -rw-r--r-- | py/mpstate.h | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/extmod/uos_dupterm.c b/extmod/uos_dupterm.c index e18d133b9..826bf1715 100644 --- a/extmod/uos_dupterm.c +++ b/extmod/uos_dupterm.c @@ -201,4 +201,6 @@ STATIC mp_obj_t mp_uos_dupterm(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_uos_dupterm_obj, 1, 2, mp_uos_dupterm); -#endif +MP_REGISTER_ROOT_POINTER(mp_obj_t dupterm_objs[MICROPY_PY_OS_DUPTERM]); + +#endif // MICROPY_PY_OS_DUPTERM diff --git a/py/mpstate.h b/py/mpstate.h index 67146d282..53bb882ce 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -198,10 +198,6 @@ typedef struct _mp_state_vm_t { // root pointers for extmod - #if MICROPY_PY_OS_DUPTERM - mp_obj_t dupterm_objs[MICROPY_PY_OS_DUPTERM]; - #endif - #if MICROPY_PY_LWIP_SLIP mp_obj_t lwip_slip_stream; #endif |
