Answer by JimmyB for Memory allocation in embedded software development
The problem with dynamic memory allocation is just that it quickly becomes non-deterministic. First, in contrast to static allocation, dynamic memory allocation is not checked at compile/link time, so...
View ArticleAnswer by Dmitry Grigoryev for Memory allocation in embedded software...
Dynamic memory allocation only makes sense if you have an OS with dynamic tasks.On an embedded system your software is the only thing that will ever run. So you have an option to allocate 1000 bytes...
View ArticleAnswer by Lundin for Memory allocation in embedded software development
How do you handle memory allocation when you have no idea how much space you need ?You specify as much as you need to handle the worst case scenario. Not more, not less. You can't have an embedded...
View ArticleAnswer by Simon B for Memory allocation in embedded software development
You statically allocate memory for the worst case that you intend to support. If you intend to support up to 1000 values, create an array of 1000 items. Plan what you want the software to do if you...
View ArticleAnswer by Cursorkeys for Memory allocation in embedded software development
In the example below, is it really better to allocate 1000 values and end up using 30 values because you don't know how many values you really need ?In my experience, this is not a problem I've...
View ArticleAnswer by Michel Keijzers for Memory allocation in embedded software development
First, the problem is not the allocation, but freeing the allocated memory. This (can) lead(s) to memory gaps and pointers pointing to 'nothing' (so called dangling pointers).So one 'solution' is to...
View ArticleMemory allocation in embedded software development
In embedded systems, the use of dynamic allocation is strongly discouraged. MISRA C do not allow using malloc and calloc because of their unexpected behaviour. My question is: How do you handle memory...
View Article