FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2013 Threads] Direct using pvPortMalloc() and vPortFree() Posted by znatok on November 10, 2013 Hi,
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:
1. Is it generally OK to use FreeRTOS for heap management not only related to FreeRTOS resources.
2. Are this functions thread safe?
3. I'm currently using heap2. I've read about fragmentation problem so I plan to pass to heap4 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)?
Thanks.
Direct using pvPortMalloc() and vPortFree() Posted by richardbarry on November 10, 2013 Yes it is fine to use pvPortMalloc() and vPortFree() in the application.
Yes they are thread safe.
Best to use heap_4.c
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|