Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

pvPortMalloc() allocates extra bytes

Posted by chaabanemalki on August 25, 2014

Hello, I notice that if I allocate 6 bytes using pvPortMalloc(6), FreeRTOS+Trace shows me that the kernel allocated 16 bytes and not 6, I tried different values but FreeRTOS+Traces always shows me different values than the ones I put in my code and with no pattern between them.

I'm not sure if this is normal or it is freeRTOS+Trace who shows wronge values.

I checked the value passed to pvPortMalloc( size_t xWantedSize )

and the definition of sizet is : typedef __SIZETYPE__ size_t; /* type yielded by sizeof */

I'm using PIC32, and i'm not sure if size_t will be considered as int32 or int8.

Thank you.


pvPortMalloc() allocates extra bytes

Posted by bowerymarc on August 25, 2014

Take a look at the heap code and you’ll understand why there’s a difference.

On Aug 25, 2014, at 9:03 AMEDT, Hicham chaabanemalki@users.sf.net wrote:

Hello, I notice that if I allocate 6 bytes using pvPortMalloc(6), FreeRTOS+Trace shows me that the kernel allocated 16 bytes and not 6, I tried different values but FreeRTOS+Traces always shows me different values than the ones I put in my code and with no pattern between them.

I'm not sure if this is normal or it is freeRTOS+Trace who shows wronge values.

I checked the value passed to pvPortMalloc( size_t xWantedSize )

and the definition of sizet is : typedef SIZETYPE size_t; / type yielded by sizeof /

I'm using PIC32, and i'm not sure if size_t will be considered as int32 or int8.

Thank you.

pvPortMalloc() allocates extra bytes

Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/


pvPortMalloc() allocates extra bytes

Posted by chaabanemalki on August 25, 2014
		/* The wanted size is increased so it can contain a BlockLink_t
		structure in addition to the requested amount of bytes. */

got it ;). I should take these 10 extra bytes in consideration when calculating the heap worst case scenario.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists