heap: Support adding new heap regions at runtime

To facilitate this, the list of registered heap regions is now a linked list
(allowing entries to be appended at runtime.)
This commit is contained in:
Angus Gratton
2017-08-28 17:12:29 +10:00
committed by Angus Gratton
parent 11a87ca811
commit 5361c08989
10 changed files with 355 additions and 68 deletions

View File

@@ -33,25 +33,6 @@
#define MALLOC_CAP_SPISRAM (1<<10) ///< Memory must be in SPI SRAM
#define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker
/**
* @brief Initialize the capability-aware heap allocator.
*
* This is called once in the IDF startup code. Do not call it
* at other times.
*/
void heap_caps_init();
/**
* @brief Enable heap(s) in memory regions where the startup stacks are located.
*
* On startup, the pro/app CPUs have a certain memory region they use as stack, so we
* cannot do allocations in the regions these stack frames are. When FreeRTOS is
* completely started, they do not use that memory anymore and heap(s) there can
* be enabled.
*/
void heap_caps_enable_nonos_stack_heaps();
/**
* @brief Allocate a chunk of memory which has the given capabilities
*