# FreeRTOS List usage

**URL:** <https://forums.freertos.org/t/freertos-list-usage/16151>\
**Category:** Kernel\
**Created:** [November 9, 2022, 6:28am UTC](https://forums.freertos.org/t/freertos-list-usage/16151 "2022-11-09T06:28:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrm2519](https://avatars.discourse-cdn.com/v4/letter/h/f19dbf/32.png) [@hrm2519](https://forums.freertos.org/u/hrm2519)\
**Post date:** [November 9, 2022, 6:28am UTC](https://forums.freertos.org/t/freertos-list-usage/16151/1 "2022-11-09T06:28:54Z")

</div>

Hi,

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.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [November 9, 2022, 6:44am UTC](https://forums.freertos.org/t/freertos-list-usage/16151/2 "2022-11-09T06:44:14Z")

</div>

> [@hrm2519](#):
>
> I wanted to know whether I can use this in the application

It is written to be used for internal kernel data structures but if it suits your application needs, you can use it.

> [@hrm2519](#):
>
> Also, does the list use static memory allocation or dynamic memory allocation?

The list implementation does not allocate any memory. As the user of the list, you will manage memory.

---

<div class="post-metadata">

**Author:** ![hrm2519](https://avatars.discourse-cdn.com/v4/letter/h/f19dbf/32.png) [@hrm2519](https://forums.freertos.org/u/hrm2519)\
**Post date:** [November 9, 2022, 8:53am UTC](https://forums.freertos.org/t/freertos-list-usage/16151/3 "2022-11-09T08:53:09Z")

</div>

Could you point me to any example usage?

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [November 9, 2022, 9:32am UTC](https://forums.freertos.org/t/freertos-list-usage/16151/4 "2022-11-09T09:32:18Z")

</div>

You can look into tasks.c file for how to use it.

---

<div class="post-metadata">

**Author:** ![stjepan\_skrnjug](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stjepan\_skrnjug](https://forums.freertos.org/u/stjepan_skrnjug)\
**Post date:** [November 9, 2022, 10:09am UTC](https://forums.freertos.org/t/freertos-list-usage/16151/5 "2022-11-09T10:09:25Z")

</div>

Hello, maybe you can get a liitle bit more of understanding from this page:  
[https://www.aosabook.org/en/freertos.html](https://www.aosabook.org/en/freertos.html)

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 9, 2022, 5:00pm UTC](https://forums.freertos.org/t/freertos-list-usage/16151/6 "2022-11-09T17:00:29Z")

</div>

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.
