Search code examples
allocationfreertos

Can I use both static and dynamic allocation in FreeRTOS?


I have some modules of application designed for static allocation, and some modules designed for dynamic allocation.

Can I use both static and dynamic allocation in one application, like this?

#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configSUPPORT_STATIC_ALLOCATION  1

Are there any disadvantages of this configuration?


Solution

  • As mentioned in the official documentation, you can use both in the same application.

    Both methods have pros and cons, and both methods can be used within the same RTOS application.