Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is it good to use dynamic memory allocation in embedded programming?

0
Posted

Is it good to use dynamic memory allocation in embedded programming?

0

Before starting I have to mention few references which were really usefull resources in my “Embedded tips and tricks” – related posts. One of them is Dan Saks’ articles and columns on Embedded.com and another one is Netrino web site and Michael Barrs’ articles. I thought of writing this post in order to explain possible benefits but also the drawbacks that are induced by dynamic memory allocation… in embedded programming. I excluded any faulty use of dynamic allocation such as memory leaks or dangling pointers, so my assumption is that data is correctly allocated and de-allocated. First of all let me just integrate dynamic allocation in the general storage types classification, there are three types (at least in C): Static storage – variables which exist during the whole program execution time; those are global variables and those variables explicitly declared as static Automatic storage- variables which are allocated upon entrance into a block (something delimited by curly brackets {}

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123