kopia lustrzana https://github.com/micropython/micropython
shared/runtime/pyexec: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register repl_line instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>pull/8922/head
rodzic
7e4b205cb0
commit
68f46342aa
|
@ -68,7 +68,7 @@ SRC_C += $(SRC_MOD)
|
||||||
|
|
||||||
SRC_CXX += $(SRC_MOD_CXX)
|
SRC_CXX += $(SRC_MOD_CXX)
|
||||||
|
|
||||||
SRC_QSTR += shared/readline/readline.c
|
SRC_QSTR += shared/readline/readline.c shared/runtime/pyexec.c
|
||||||
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX)
|
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX)
|
||||||
|
|
||||||
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
||||||
|
|
|
@ -42,7 +42,7 @@ SRC_C = \
|
||||||
shared/runtime/stdout_helpers.c \
|
shared/runtime/stdout_helpers.c \
|
||||||
$(BUILD)/_frozen_mpy.c \
|
$(BUILD)/_frozen_mpy.c \
|
||||||
|
|
||||||
SRC_QSTR += shared/readline/readline.c
|
SRC_QSTR += shared/readline/readline.c shared/runtime/pyexec.c
|
||||||
|
|
||||||
OBJ = $(PY_CORE_O)
|
OBJ = $(PY_CORE_O)
|
||||||
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
||||||
|
|
|
@ -198,10 +198,6 @@ typedef struct _mp_state_vm_t {
|
||||||
|
|
||||||
// root pointers for extmod
|
// root pointers for extmod
|
||||||
|
|
||||||
#if MICROPY_REPL_EVENT_DRIVEN
|
|
||||||
vstr_t *repl_line;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MICROPY_PY_OS_DUPTERM
|
#if MICROPY_PY_OS_DUPTERM
|
||||||
mp_obj_t dupterm_objs[MICROPY_PY_OS_DUPTERM];
|
mp_obj_t dupterm_objs[MICROPY_PY_OS_DUPTERM];
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -488,6 +488,8 @@ int pyexec_event_repl_process_char(int c) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MP_REGISTER_ROOT_POINTER(vstr_t * repl_line);
|
||||||
|
|
||||||
#else // MICROPY_REPL_EVENT_DRIVEN
|
#else // MICROPY_REPL_EVENT_DRIVEN
|
||||||
|
|
||||||
int pyexec_raw_repl(void) {
|
int pyexec_raw_repl(void) {
|
||||||
|
|
Ładowanie…
Reference in New Issue