From 60aa550ec7c591487c9613f4885ac2f39f8b6497 Mon Sep 17 00:00:00 2001 From: Nicolas Kruse Date: Thu, 9 Oct 2025 22:46:06 +0200 Subject: [PATCH] small changes --- src/copapy/__init__.py | 3 +++ src/coparun/runmem.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/copapy/__init__.py b/src/copapy/__init__.py index 8b457e2..21d21ca 100644 --- a/src/copapy/__init__.py +++ b/src/copapy/__init__.py @@ -356,6 +356,9 @@ def compile_to_instruction_list(node_list: Iterable[Node], sdb: stencil_database object_list, data_section_lengths = variable_mem_layout(variable_list) + # Deallocate old allocated memory (if existing) + dw.write_com(binw.Command.FREE_MEMORY) + # Write data dw.write_com(binw.Command.ALLOCATE_DATA) dw.write_int(data_section_lengths) diff --git a/src/coparun/runmem.c b/src/coparun/runmem.c index c9d311b..29251b0 100644 --- a/src/coparun/runmem.c +++ b/src/coparun/runmem.c @@ -100,8 +100,8 @@ int parse_commands(uint8_t *bytes) { offs = *(uint32_t*)bytes; bytes += 4; reloc_type = *(uint32_t*)bytes; bytes += 4; value = *(int32_t*)bytes; bytes += 4; - printf("PATCH_OBJECT patch_offs=%i reloc_type=%i value=%i data_offs=%i\n", - offs, reloc_type, value, data_offs); + printf("PATCH_OBJECT patch_offs=%i reloc_type=%i value=%i\n", + offs, reloc_type, value); patch(executable_memory + offs, reloc_type, value + data_offs); break;