Hi all ,
I am experiencing some weird behavior when using heap_4.c , i have allocated 1.5 megabyte of RAM for the usage of heap_4 , so i should have plenty of memory to use .
After some time ( and many allocations that have been made ) , all of a sudden the program gets stuck in infinite loop in the function called :
static void QA_prvInsertBlockIntoFreeList( QA_xBlockLink *pxBlockToInsert )
And the infinite loop is here :
/* Iterate through the list until a block is found that has a higher address than the block being inserted. */
for( pxIterator = &QA_xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )
/* Nothing to do here, just iterate to the right position. */
Could any one can tell me why this occur? is it some kind of memory fragmentation ?