Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/coverity/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configSUPPORT_HEAP_REALLOC 0
#define configTOTAL_HEAP_SIZE 4096U
#define configAPPLICATION_ALLOCATED_HEAP 1
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
Expand Down
5 changes: 5 additions & 0 deletions examples/template_configuration/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@
* https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */
#define configSUPPORT_DYNAMIC_ALLOCATION 1

/* Set configSUPPORT_HEAP_REALLOC to 1 to include FreeRTOS API functions
* that support reallocating memory blocks in the build. Set to 0 to exclude
* realloc support from the build. Defaults to 0 if left undefined. */
#define configSUPPORT_HEAP_REALLOC 0

/* Sets the total size of the FreeRTOS heap, in bytes, when heap_1.c, heap_2.c
* or heap_4.c are included in the build. This value is defaulted to 4096 bytes
* but it must be tailored to each application. Note the heap will appear in
Expand Down
8 changes: 8 additions & 0 deletions include/FreeRTOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -2840,6 +2840,14 @@
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#endif

#ifndef configSUPPORT_HEAP_REALLOC
#define configSUPPORT_HEAP_REALLOC 0
#endif

#if ( ( configSUPPORT_HEAP_REALLOC > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
#error configSUPPORT_HEAP_REALLOC cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
#endif

#if ( ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
#error configUSE_STATS_FORMATTING_FUNCTIONS cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
#endif
Expand Down
4 changes: 4 additions & 0 deletions include/portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats );
void * pvPortMalloc( size_t xWantedSize ) PRIVILEGED_FUNCTION;
void * pvPortCalloc( size_t xNum,
size_t xSize ) PRIVILEGED_FUNCTION;
#if ( configSUPPORT_HEAP_REALLOC == 1 )
void *pvPortRealloc( void *pv,
size_t xWantedSize ) PRIVILEGED_FUNCTION;
#endif
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
Expand Down
Loading