]> granicus.if.org Git - esp-idf/commitdiff
heap: When adding a new heap, allocate its metadata block from internal memory only
authorAngus Gratton <angus@espressif.com>
Mon, 20 Aug 2018 06:12:14 +0000 (16:12 +1000)
committerbot <bot@espressif.com>
Thu, 30 Aug 2018 06:18:18 +0000 (06:18 +0000)
components/heap/heap_caps_init.c

index af1e27df4a5c74af57cac27cf467c3f9de85fdad..d675e408d99ddde3b1fd9378a0b3883489a23d51 100644 (file)
@@ -206,7 +206,7 @@ esp_err_t heap_caps_add_region_with_caps(const uint32_t caps[], intptr_t start,
         }
     }
 
-    heap_t *p_new = malloc(sizeof(heap_t));
+    heap_t *p_new = heap_caps_malloc(sizeof(heap_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
     if (p_new == NULL) {
         err = ESP_ERR_NO_MEM;
         goto done;