Quality RTOS & Embedded Software

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




Loading

malloc to separate memory regions

Posted by logicanalyzer on September 16, 2016

I have different classes of memory, (faster, slower, nearby, farther away) and I would like to control where malloc allocates memory. The heap_5 scheme allows the heap to span multiple non-contiguous memory regions but treats them as a single heap.

I need separate heaps and a way to control which one malloc allocates from. Is there a straightforward way to do this, or do I need to write heap_6.c?


malloc to separate memory regions

Posted by rtel on September 16, 2016

I think there might be a change request on this topic already. Basically it is not a straight forward change because it would need a new parameter to the pvPortMalloc() function, and that would have lots of backward compatibility issues. However, you can have more than one memory allocator in your application - so the FreeRTOS code would call the 'standard' pvPortMalloc(), and your application can call whichever memory allocation function is most appropriate for the memory being allocated.


malloc to separate memory regions

Posted by dumarjo on September 16, 2016

Hi,

This is how we do it.

Jonathan

Le 16/09/2016 à 14:20, Real Time Engineers ltd. a écrit : > > I think there might be a change request on this topic already. > Basically it is not a straight forward change because it would need a > new parameter to the pvPortMalloc() function, and that would have lots > of backward compatibility issues. However, you can have more than one > memory allocator in your application - so the FreeRTOS code would call > the 'standard' pvPortMalloc(), and your application can call whichever > memory allocation function is most appropriate for the memory being > allocated. > > ------------------------------------------------------------------------ > > malloc to separate memory regions > https://sourceforge.net/p/freertos/discussion/382005/thread/65d41896/?limit=25#c823 > > ------------------------------------------------------------------------ > > 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/ >


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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