examples/slsiwifi: Fix build error for new heap
replace mm_get_heap_info to mm_get_heap_with_index for checking heap information, because mm_get_heap needs allocated address for getting heap structure.
heapinfo_parse() was changed to pass 3-params
@@ -57,6 +57,7 @@ sem_t g_sem_result;
sem_t g_sem_join;
static uint8_t g_join_result = 0;
#define WPA_MAX_SSID_LEN (4*32+1) /* SSID encoded in a string - worst case is all 4-octet hex digits + '\0' */
+#define BASE_HEAP_INDEX 0
/****************************************************************************
* Defines
@@ -104,7 +105,7 @@ static struct mm_heap_s *g_user_heap;
int g_memstat_total = 0;
static int getMemUsage(void)
{
- g_user_heap = mm_get_heap_info();
+ g_user_heap = mm_get_heap_with_index(BASE_HEAP_INDEX);
printf("\n\tCurrent memory usage (total): %d bytes\n", g_user_heap->total_alloc_size);
return g_user_heap->total_alloc_size;
}
@@ -118,7 +119,7 @@ int getMemLeaks(void)
// situations where the the blocks are freed while
// exiting
//print heapinfo
- heapinfo_parse(mm_get_heap_info(), HEAPINFO_TRACE);
+ heapinfo_parse(mm_get_heap_with_index(BASE_HEAP_INDEX), HEAPINFO_DETAIL_ALL, HEAPINFO_PID_ALL);
printf(" ______________________________________________________________ \n");
printf("| |\n");
printf("| WARNING: %6.6d bytes leaked during this run |\n", result);
