Memory allocation isn't necessarily at the top of a developer's list of favorite topics to consider when developing an application—it just isn't all that glamorous. Dynamic allocation of memory—that is, allocating memory as it is needed rather than at the beginning of the program—is the norm. With desktop-oriented development, memory is generally available whenever it is needed, so it isn't given a second thought; it is simply a malloc call away. When it is finished, it will be unallocated with free.
Unlike the carefree dynamic memory allocation schemes in a desktop environment, programmers of deeply embedded systems that use MCUs will often need to be more careful about how (and if) memory is dynamically allocated. In an embedded system, regulatory, RAM, and timing constraints can all play a role in whether...