Hello Everyone
I am working on an embedded system wherein I have limited available space. I know there is a dynamic memory allocation available for link list creation but I want to create a link list using static memory allocation. Dynamic memory allocation leads to or may lead to leaks if multiple dynamic allocations takes place. I am not sure, however there is a big possibility that if memory management is not handled in a static manner, may lead to leaks and crush especially in embedded system.
So I wanted to know if anyone has any suggestion as to how to create a link list using static memory management. The system needs to create c link list by adding an element to the link list(if the element is already present then discard the element).
Thanks to everyone.Code:typedef struct node; struct node { uint8_t id; struct node *next; }