Skip to content

Commit 68f4634

Browse files
dlechdpgeorge
authored andcommitted
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>
1 parent 7e4b205 commit 68f4634

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

ports/minimal/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ SRC_C += $(SRC_MOD)
6868

6969
SRC_CXX += $(SRC_MOD_CXX)
7070

71-
SRC_QSTR += shared/readline/readline.c
71+
SRC_QSTR += shared/readline/readline.c shared/runtime/pyexec.c
7272
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX)
7373

7474
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))

ports/powerpc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SRC_C = \
4242
shared/runtime/stdout_helpers.c \
4343
$(BUILD)/_frozen_mpy.c \
4444

45-
SRC_QSTR += shared/readline/readline.c
45+
SRC_QSTR += shared/readline/readline.c shared/runtime/pyexec.c
4646

4747
OBJ = $(PY_CORE_O)
4848
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))

py/mpstate.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ typedef struct _mp_state_vm_t {
198198

199199
// root pointers for extmod
200200

201-
#if MICROPY_REPL_EVENT_DRIVEN
202-
vstr_t *repl_line;
203-
#endif
204-
205201
#if MICROPY_PY_OS_DUPTERM
206202
mp_obj_t dupterm_objs[MICROPY_PY_OS_DUPTERM];
207203
#endif

shared/runtime/pyexec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@ int pyexec_event_repl_process_char(int c) {
488488
return res;
489489
}
490490

491+
MP_REGISTER_ROOT_POINTER(vstr_t * repl_line);
492+
491493
#else // MICROPY_REPL_EVENT_DRIVEN
492494

493495
int pyexec_raw_repl(void) {

0 commit comments

Comments
 (0)