Yes.. that is something I knew already. And I do not believe in "dumbing it down for the average people". When you say that something is "a hassle" or difficult for an average mcu programmer, you are practically saying "you are too stupid to get any better". It is better to say things as they are and leave it to the reader to consider if the topic is too advanced or not.
I'm not saying that anyone is stupid.
What I'm saying is this: Let's suppose you've got a library that does dynamic memory allocation, garbage collection etc., so that you can have a non-fragmentable heap in 2K (or may be even 1K) memory space. Then you give it to a typical MCU programmer, but he tells you: "no, that's too much hassle, I'd be better off with fixed memory".
Of course there could be some people who might find it useful, but I suspect these will be rare and far between.
So anyway, do you think there is no situation where dynamic memory allocation is "safe and elegant" solution? That is my challenge.. to find an example where using dynamic memory allocation is a very good solution.
You can think of something. For example, if you have a network (such as CAN) and you don't know how many nodes and of what kind you might encounter. You need to dynamically allocate memory to hold information for each new node you discover and then free this memory when the node disconnects.
There are two dangers here - defragmentation and running out of memory. You can combat defragmentation by allocating the same size (which is a max for node kinds), but this will require more memory. Or you can combat defragmentation by using handles. Or you can keep the memory allocated in case the node comes back.
Or you just get a bigger processor, which is what most people would do (wanted to say "waht average programmer would do", but I'm getting better at this
)
Are you writing a book or something?