From 050b09719eb4eb55079dbf06761208d5dc2de638 Mon Sep 17 00:00:00 2001 From: Stephen Casner Date: Mon, 8 Jan 2018 17:29:47 -0800 Subject: [PATCH] Track SPIRAM allocations separately as a 4th type --- components/heap/esp_heap_debug.c | 2 ++ components/heap/include/esp_heap_debug.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/heap/esp_heap_debug.c b/components/heap/esp_heap_debug.c index 2f0c42067..a38f757a9 100644 --- a/components/heap/esp_heap_debug.c +++ b/components/heap/esp_heap_debug.c @@ -51,6 +51,8 @@ size_t esp_heap_debug_dump_totals(heap_dump_totals_t* totals, size_t* ntotal, si ++type; if (!(caps & MALLOC_CAP_8BIT)) ++type; + if (caps & MALLOC_CAP_SPIRAM) + type = 3; b = &meta->first_block; multi_heap_internal_lock(meta); while (b && remaining > 0) { diff --git a/components/heap/include/esp_heap_debug.h b/components/heap/include/esp_heap_debug.h index 92c207f69..ddbca2b68 100644 --- a/components/heap/include/esp_heap_debug.h +++ b/components/heap/include/esp_heap_debug.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define NUM_USED_TYPES 3 +#define NUM_USED_TYPES 4 typedef struct { TaskHandle_t task;