diff --git a/bare-arm/main.c b/bare-arm/main.c index 7efcf9ab33..e6ce063989 100644 --- a/bare-arm/main.c +++ b/bare-arm/main.c @@ -34,9 +34,6 @@ int main(int argc, char **argv) { return 0; } -void gc_collect(void) { -} - mp_lexer_t *mp_lexer_new_from_file(const char *filename) { return NULL; } diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index a9e058c1c4..ddecb6a8d8 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -110,7 +110,6 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind, if ((exec_flags & EXEC_FLAG_ALLOW_DEBUGGING) && repl_display_debugging_info) { mp_uint_t ticks = mp_hal_ticks_ms() - start; // TODO implement a function that does this properly printf("took " UINT_FMT " ms\n", ticks); - gc_collect(); // qstr info { mp_uint_t n_pool, n_qstr, n_str_data_bytes, n_total_bytes; @@ -118,8 +117,11 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind, printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes); } - // GC info + #if MICROPY_ENABLE_GC + // run collection and print GC info + gc_collect(); gc_dump_info(); + #endif } if (exec_flags & EXEC_FLAG_PRINT_EOF) {