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] [May 2017 Threads] Has anyone modified heap_4.c to add an optimized realloc?Posted by cdebrebisson on May 10, 2017 Hello,
Well, I guess the whole question lies in the title.
I have been batteling between using the FreeRTOS provided heap management and the compiler provided memory management.
The FreeRTOS scheme is winning at the moment because I can easely make isso that the memory size is defined at run time and not comile time (since the board can be loaded in the factory with any size RAM)...
However, I do need a realloc and I would like it to be more optimized than a basic malloc/copy/free scheme (ie: free extra ram if shrink and grow in place (if possible)).
Has anyone ever implemented such function in heap4.c?
Cyrille
Has anyone modified heap_4.c to add an optimized realloc?Posted by richard_damon on May 10, 2017 If you want realloc, I would go to heap_3.c and use that method. The other option which is available with some implementations, is to see if your library has hooks in it to make malloc/free/realloc thread safe (I know some versiion of newlib have this).
Has anyone modified heap_4.c to add an optimized realloc?Posted by cdebrebisson on May 10, 2017 Hello,
Except that this assumes that the linker does have a free/malloc/realloc, which is not the case for me (well, more specially, I do not want to use their versions because I can not modify them and make them able to deal with my ram which is of unknown size at build time. Size is detected at run time).
Cyrille
Has anyone modified heap_4.c to add an optimized realloc?Posted by rtel on May 10, 2017 Most people use a crude free and re-allocation. I'm not aware of
anything more sophisticated.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|