Skip to content

Commit

Permalink
Heap: add new API to reset xMinimumEverFreeBytesRemaining.
Browse files Browse the repository at this point in the history
This commit adds new API functionality to reset xMinimumEverFreeBytesRemaining.
This functionality provides ability to get heap statistics during a particular period of time.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
  • Loading branch information
TomasGalbickaNXP committed Nov 11, 2024
1 parent d0d55f3 commit 4287edf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
void xPortResetHeapMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;

#if ( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 )
void * pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION;
Expand Down
6 changes: 6 additions & 0 deletions portable/MemMang/heap_4.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ size_t xPortGetMinimumEverFreeHeapSize( void )
}
/*-----------------------------------------------------------*/

void xPortResetHeapMinimumEverFreeHeapSize( void )
{
xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;
}
/*-----------------------------------------------------------*/

void vPortInitialiseBlocks( void )
{
/* This just exists to keep the linker quiet. */
Expand Down

0 comments on commit 4287edf

Please sign in to comment.