Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


commit id 1825: Heap_x functions

Posted 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. */

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.


RE: commit id 1825: Heap_x functions

Posted 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

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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner