mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Create a new variable xAllocatedBlockSize for traceMALLOC()
This commit is contained in:
parent
2d5c193a0f
commit
3a6f50487e
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* If this is the first call to malloc then the heap will require
|
/* If this is the first call to malloc then the heap will require
|
||||||
* initialisation to setup the list of free blocks. */
|
* initialisation to setup the list of free blocks. */
|
||||||
|
@ -360,7 +361,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -374,6 +375,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned by
|
/* The block is being returned - it is allocated and owned by
|
||||||
* the application and has no "next" block. */
|
* the application and has no "next" block. */
|
||||||
secureheapALLOCATE_BLOCK( pxBlock );
|
secureheapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -394,10 +397,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
|
|
||||||
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
#if ( secureconfigUSE_MALLOC_FAILED_HOOK == 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -160,6 +160,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
if( xWantedSize > 0 )
|
if( xWantedSize > 0 )
|
||||||
{
|
{
|
||||||
|
@ -258,13 +259,11 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
* iterate to find the right place to insert new block. */
|
* iterate to find the right place to insert new block. */
|
||||||
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
|
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned
|
/* The block is being returned - it is allocated and owned
|
||||||
* by the application and has no "next" block. */
|
* by the application and has no "next" block. */
|
||||||
heapALLOCATE_BLOCK( pxBlock );
|
heapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -273,10 +272,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
}
|
}
|
||||||
( void ) xTaskResumeAll();
|
( void ) xTaskResumeAll();
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
if( xWantedSize > 0 )
|
if( xWantedSize > 0 )
|
||||||
{
|
{
|
||||||
|
@ -288,7 +289,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -302,6 +303,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned
|
/* The block is being returned - it is allocated and owned
|
||||||
* by the application and has no "next" block. */
|
* by the application and has no "next" block. */
|
||||||
heapALLOCATE_BLOCK( pxBlock );
|
heapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -323,10 +326,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
}
|
}
|
||||||
( void ) xTaskResumeAll();
|
( void ) xTaskResumeAll();
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
BlockLink_t * pxNewBlockLink;
|
BlockLink_t * pxNewBlockLink;
|
||||||
void * pvReturn = NULL;
|
void * pvReturn = NULL;
|
||||||
size_t xAdditionalRequiredSize;
|
size_t xAdditionalRequiredSize;
|
||||||
|
size_t xAllocatedBlockSize = 0;
|
||||||
|
|
||||||
/* The heap must be initialised before the first call to
|
/* The heap must be initialised before the first call to
|
||||||
* pvPortMalloc(). */
|
* pvPortMalloc(). */
|
||||||
|
@ -316,7 +317,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xWantedSize = pxBlock->xBlockSize;
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
@ -330,6 +331,8 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xAllocatedBlockSize = pxBlock->xBlockSize;
|
||||||
|
|
||||||
/* The block is being returned - it is allocated and owned
|
/* The block is being returned - it is allocated and owned
|
||||||
* by the application and has no "next" block. */
|
* by the application and has no "next" block. */
|
||||||
heapALLOCATE_BLOCK( pxBlock );
|
heapALLOCATE_BLOCK( pxBlock );
|
||||||
|
@ -351,10 +354,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
traceMALLOC( pvReturn, xWantedSize );
|
traceMALLOC( pvReturn, xAllocatedBlockSize );
|
||||||
|
|
||||||
/* Prevent compiler warnings when trace macros are not used. */
|
/* Prevent compiler warnings when trace macros are not used. */
|
||||||
( void ) xWantedSize;
|
( void ) xAllocatedBlockSize;
|
||||||
}
|
}
|
||||||
( void ) xTaskResumeAll();
|
( void ) xTaskResumeAll();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue