In my application I need some malloc/free mechanism. Considering that FreeRTOS already has pvPortMalloc() and vPortFree() I plan to use this functions instead of invoacation of the standard library. I have a few questions regarding this:
- Is it generally OK to use FreeRTOS for heap management not only related to FreeRTOS resources.
- Are this functions thread safe?
- I’m currently using heap_2. I’ve read about fragmentation problem so I plan to pass to heap_4 unless heap_2 has best match allocation? I mean if I’m going to allocate and free blocks of let’s say 100 and 50 bytes in random order am I going to end up with memory luck for 100 bytes block (as all memory will be 50 bytes fragmented)?