From ff807f8f19a991c1aba7504b8ba17023ee738fa6 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Sat, 4 Sep 2021 11:17:39 +0200 Subject: [PATCH] Fix incorrect use of allocate_memory() --- main.c | 2 +- shared-bindings/supervisor/__init__.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index d6ed269809..d024717beb 100755 --- a/main.c +++ b/main.c @@ -236,7 +236,7 @@ STATIC void cleanup_after_vm(supervisor_allocation* heap, mp_obj_t exception) { size_t traceback_len = 0; mp_print_t print_count = {&traceback_len, count_strn}; mp_obj_print_exception(&print_count, exception); - prev_traceback_allocation = allocate_memory(align32_size(traceback_len + 1), false, true); + prev_traceback_allocation = allocate_memory(align32_size(traceback_len + 1), false, false); // Empirically, this never fails in practice - even when the heap is totally filled up // with single-block-sized objects referenced by a root pointer, exiting the VM frees // up several hundred bytes, sufficient for the traceback (which tends to be shortened diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index a9b99ed87d..8c581c9364 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -195,7 +195,7 @@ STATIC mp_obj_t supervisor_set_next_code_file(size_t n_args, const mp_obj_t *pos const char *filename = mp_obj_str_get_data(args.filename.u_obj, &len); free_memory(next_code_allocation); if (options != 0 || len != 0) { - next_code_allocation = allocate_memory(align32_size(sizeof(next_code_info_t) + len + 1), false, true); + next_code_allocation = allocate_memory(align32_size(sizeof(next_code_info_t) + len + 1), false, false); if (next_code_allocation == NULL) { m_malloc_fail(sizeof(next_code_info_t) + len + 1); }