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] [February 2013 Threads] commit id 1825: Heap_x functionsPosted by Friedrich Lobenstock on February 15, 2013 commit id 1825: Heap_x functions now automatically align the start of the heap without using the portDOUBLE union member. /* A few bytes might be lost to byte aligning the heap start address. */ #define configADJUSTED_HEAP_SIZE( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
Can't we taken into account if the heap was already aligned before instead of always sacrificing portBYTE_ALIGNMENT bytes? Couldn't this be accomplished by updating e.g. xFreeBytesRemaining in prvHeapInit() accordingly? Just my 2 euro cents. Regards Friedl
RE: commit id 1825: Heap_x functionsPosted by Richard on February 17, 2013 I answered this some time ago, but it seems my reply has not turned up in the forum. The reply went something like this:
The first time I implemented the change I did something like:
if( heap already aligned then ) { basically do nothing } else { align }
but that required (in some of the heap_x implementations) a new variable because the adjusted heap size became variable rather than constant. Therefore the RAM saving was halved, so with that in mind, plus the fact the solution was ugly (coding standard required a *lot* of casting to an from pointers), I decided just to go for the simplest solution.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|