I can see that FreeRTOS provides list.c file for using list functionality. I wanted to know whether I can use this in the application as there aren’t any examples which show how to do that. Also, does the list use static memory allocation or dynamic memory allocation? It would be of great help to clarify the above things.
It is written to be used for internal kernel data structures but if it suits your application needs, you can use it.
The list implementation does not allocate any memory. As the user of the list, you will manage memory.
Could you point me to any example usage?
You can look into tasks.c file for how to use it.
Hello, maybe you can get a liitle bit more of understanding from this page:
As aggarg@ already said - the list is not part of the published API and doesn’t have examples because it is intended for internal use. That means its implementation and API can change at any time as such changes aren’t considered to break backward compatibility (as we don’t intend users to be touching the list anyway). Of course, being open source, the source file is available for you to use if you wish - just be forewarned of the risks of doing so. FreeRTOS uses quite strict data hiding for nearly all private data (such as the TCB, queue structures, etc.) so users can’t accidentally take a dependency on something that might change, but that isn’t the case for the lists as hiding that data has performance on convolution impact.