mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-03 12:53:52 -04:00
Fix traceMALLOC() memory count is inaccurate. (#1078)
Modify xWantedSize to the size of a free block when not split blocks. Ensure that the sizes within traceMALLOC() and traceFREE() macros are equal.
This commit is contained in:
parent
e64d1e06b3
commit
2d5c193a0f
14 changed files with 59 additions and 13 deletions
|
@ -360,7 +360,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
xWantedSize = pxBlock->xBlockSize;
|
||||
}
|
||||
|
||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||
|
@ -396,6 +396,9 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
|
||||
traceMALLOC( pvReturn, xWantedSize );
|
||||
|
||||
/* Prevent compiler warnings when trace macros are not used. */
|
||||
( void ) xWantedSize;
|
||||
|
||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||
{
|
||||
if( pvReturn == NULL )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue