diff options
| author | Alessandro Gatti <a.gatti@frob.it> | 2024-09-06 12:43:54 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-01-02 11:51:50 +1100 |
| commit | 36aa7545b0764b6304af7d8dee1b5536eda33f77 (patch) | |
| tree | c856b20087acbabf24eb7295a59a6a2d034a45fa /ports/qemu/main.c | |
| parent | 268acb714dd79fa5eeeb82c1fca022bc4ea126b7 (diff) | |
qemu/main: Make GC heap size configurable on a per-arch basis.
In certain circumstances depending on the code size, the
`deflate_decompress` test fails on both ARM and RV32 with a memory
allocation failure error. The issue is mitigated by having a larger GC
heap, in this case around 20 KBytes more than the original 100 KBytes
default.
This commit makes the GC heap size configurable on a per-arch basis, with
both ARM and RV32 using the enlarged 120 KBytes heap.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'ports/qemu/main.c')
| -rw-r--r-- | ports/qemu/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ports/qemu/main.c b/ports/qemu/main.c index dff55058e..75c6fe4cd 100644 --- a/ports/qemu/main.c +++ b/ports/qemu/main.c @@ -34,14 +34,16 @@ #include "shared/runtime/gchelper.h" #include "shared/runtime/pyexec.h" -#define HEAP_SIZE (100 * 1024) +#if MICROPY_HEAP_SIZE <= 0 +#error MICROPY_HEAP_SIZE must be a positive integer. +#endif -static uint32_t gc_heap[HEAP_SIZE / sizeof(uint32_t)]; +static uint32_t gc_heap[MICROPY_HEAP_SIZE / sizeof(uint32_t)]; int main(int argc, char **argv) { mp_stack_ctrl_init(); mp_stack_set_limit(10240); - gc_init(gc_heap, (char *)gc_heap + HEAP_SIZE); + gc_init(gc_heap, (char *)gc_heap + MICROPY_HEAP_SIZE); for (;;) { mp_init(); |
