Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 294098d

Browse files
manobendrodpgeorge
authored andcommitted
minimal: Increase heap size for Linux builds.
Otherwise use of the REPL is quite limited. Fixes issue micropython#10644.
1 parent 4598b89 commit 294098d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ports/minimal/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) {
2929

3030
static char *stack_top;
3131
#if MICROPY_ENABLE_GC
32-
static char heap[2048];
32+
static char heap[MICROPY_HEAP_SIZE];
3333
#endif
3434

3535
int main(int argc, char **argv) {

ports/minimal/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ typedef long mp_off_t;
3333

3434
#ifdef __linux__
3535
#define MICROPY_MIN_USE_STDOUT (1)
36+
#define MICROPY_HEAP_SIZE (25600) // heap size 25 kilobytes
3637
#endif
3738

3839
#ifdef __thumb__
3940
#define MICROPY_MIN_USE_CORTEX_CPU (1)
4041
#define MICROPY_MIN_USE_STM32_MCU (1)
42+
#define MICROPY_HEAP_SIZE (2048) // heap size 2 kilobytes
4143
#endif
4244

4345
#define MP_STATE_PORT MP_STATE_VM

0 commit comments

Comments
 (0)