[Feature] Support pvPortRealloc

This commit is contained in:
skb666 2025-12-25 21:36:23 +08:00
parent 3ace38969b
commit 10f3405880
6 changed files with 497 additions and 0 deletions

View file

@ -2840,6 +2840,14 @@
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#endif
#ifndef configSUPPORT_HEAD_REALLOC
#define configSUPPORT_HEAD_REALLOC 0
#endif
#if ( ( configSUPPORT_HEAD_REALLOC > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
#error configSUPPORT_HEAD_REALLOC cannot be used without dynamic allocation, but configSUPPORT_HEAD_REALLOC 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

View file

@ -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_HEAD_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;