Dynamic memory allocation is a common practice among C++ developers, and it is widely utilized in the C++ standard library; however, in the context of embedded systems, it often becomes a source of issues that are hard to discover and hard to avoid.
The most notable issue is timing. The worst-case time for memory allocation is not-bound; however, embedded systems, especially those controlling real-world processes or equipment, are often required to respond within a specific amount of time.
Another problem is fragmentation. When memory blocks of different sizes are allocated and deallocated, memory regions appear that are technically free but cannot be allotted because they are too small to fulfill an application request. Memory fragmentation grows over time and can lead to the situation where a memory allocation request fails despite a substantial...