mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
heap: Refactor heap regions/capabilities out of FreeRTOS
Remove tagged heap API, rename caps_xxx to heap_caps_xxx Also includes additional heap_caps_xxx inspection functions.
This commit is contained in:

committed by
Angus Gratton

parent
5ee49fd311
commit
71c70cb15c
@@ -102,7 +102,7 @@
|
||||
#include "task.h"
|
||||
|
||||
#include "esp_panic.h"
|
||||
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_crosscore_int.h"
|
||||
|
||||
#include "esp_intr_alloc.h"
|
||||
@@ -442,5 +442,29 @@ uint32_t xPortGetTickRateHz(void) {
|
||||
return (uint32_t)configTICK_RATE_HZ;
|
||||
}
|
||||
|
||||
/* Heap functions, wrappers around heap_caps_xxx functions
|
||||
|
||||
NB: libc malloc() & free() are also defined & available
|
||||
for this purpose.
|
||||
*/
|
||||
|
||||
void *pvPortMalloc( size_t xWantedSize )
|
||||
{
|
||||
return heap_caps_malloc( MALLOC_CAP_8BIT, xWantedSize);
|
||||
}
|
||||
|
||||
void vPortFree( void *pv )
|
||||
{
|
||||
return heap_caps_free(pv);
|
||||
}
|
||||
|
||||
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION
|
||||
{
|
||||
return heap_caps_get_free_size( MALLOC_CAP_8BIT );
|
||||
}
|
||||
|
||||
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION
|
||||
{
|
||||
return heap_caps_get_minimum_free_size( MALLOC_CAP_8BIT );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user