Code: Select all
//#define MP_USE_MALLOC_HEAP
#ifdef MP_USE_MALLOC_HEAP
static char* mp_heap;
#else
static char mp_heap[PYTHON_HEAP_SIZE]; // Micropython's heap
#endif
.
.
#ifdef MP_USE_MALLOC_HEAP
mp_heap = (char*)malloc(PYTHON_HEAP_SIZE);
#endif
.
.
mp_stack_ctrl_init();
gc_init(mp_heap, mp_heap + PYTHON_HEAP_SIZE);
mp_init();
Built time heap Malloc runtime heap
Anyone have any ideas as to why am I getting more memory leak from the dynamically allocated heap?