Because FreeRTOS targets such a wide range of MCUs and applications, it ships with five different dynamic allocation schemes, all of which are implemented with a heap. The different heap implementations allow different levels of heap functionality. They are included in the portable/MemMang directory as heap_1.c, heap_2.c, heap_3.c, heap_4.c, and heap_5.c.
A note on memory pools:
Many other RTOSes include memory pools as an implementation for dynamic memory allocation. A memory pool achieves dynamic allocation by only allocating and freeing fixed-size blocks. By fixing the block size, the problem of fragmentation is avoided in memory-constrained environments.
The downside to memory pools is that the blocks need to be sized for each specific application. If they are too large, they will waste precious RAM; too small, and they'll be unable...
Many other RTOSes include memory pools as an implementation for dynamic memory allocation. A memory pool achieves dynamic allocation by only allocating and freeing fixed-size blocks. By fixing the block size, the problem of fragmentation is avoided in memory-constrained environments.
The downside to memory pools is that the blocks need to be sized for each specific application. If they are too large, they will waste precious RAM; too small, and they'll be unable...