Forum Discussion
Altera_Forum
Honored Contributor
15 years agoQ message allocation
This is just a general question about messaging and queues. How are you guys allocating Q messages? For instance, each message I send is a pointer to a struct. My struct contains an ENUM va...
Altera_Forum
Honored Contributor
15 years agoI prefer to use ring buffers. i do a calculation what ring buffer size is needed and add some safety margin.
Personally i am not a friend of dynamic memory allocation and freeing in embedded systems. Unless you have a serious memory shortage i see nothing wrong with allocating big chunks of memory at compile time. At least so see then very early were potential bottlenecks lie. Its also easier to test.