\r
/* The size of the structure placed at the beginning of each allocated memory\r
block must by correctly byte aligned. */\r
\r
/* The size of the structure placed at the beginning of each allocated memory\r
block must by correctly byte aligned. */\r
\r
/* Create a couple of list links to mark the start and end of the list. */\r
static BlockLink_t xStart, *pxEnd = NULL;\r
\r
/* Create a couple of list links to mark the start and end of the list. */\r
static BlockLink_t xStart, *pxEnd = NULL;\r
cast is used to prevent byte alignment warnings from the\r
compiler. */\r
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );\r
cast is used to prevent byte alignment warnings from the\r
compiler. */\r
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );\r
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;\r
\r
/* Ensure the heap starts on a correctly aligned boundary. */\r
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;\r
\r
/* Ensure the heap starts on a correctly aligned boundary. */\r
- ulAddress += ( portBYTE_ALIGNMENT - 1 );\r
- ulAddress &= ~( ( uint32_t ) portBYTE_ALIGNMENT_MASK );\r
- xTotalHeapSize -= ulAddress - ( uint32_t ) ucHeap;\r
+ uxAddress += ( portBYTE_ALIGNMENT - 1 );\r
+ uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\r
+ xTotalHeapSize -= uxAddress - ( size_t ) ucHeap;\r
\r
/* xStart is used to hold a pointer to the first item in the list of free\r
blocks. The void cast is used to prevent compiler warnings. */\r
\r
/* xStart is used to hold a pointer to the first item in the list of free\r
blocks. The void cast is used to prevent compiler warnings. */\r
\r
/* pxEnd is used to mark the end of the list of free blocks and is inserted\r
at the end of the heap space. */\r
\r
/* pxEnd is used to mark the end of the list of free blocks and is inserted\r
at the end of the heap space. */\r
- ulAddress = ( ( uint32_t ) pucAlignedHeap ) + xTotalHeapSize;\r
- ulAddress -= xHeapStructSize;\r
- ulAddress &= ~( ( uint32_t ) portBYTE_ALIGNMENT_MASK );\r
- pxEnd = ( void * ) ulAddress;\r
+ uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize;\r
+ uxAddress -= xHeapStructSize;\r
+ uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\r
+ pxEnd = ( void * ) uxAddress;\r
pxEnd->xBlockSize = 0;\r
pxEnd->pxNextFreeBlock = NULL;\r
\r
/* To start with there is a single free block that is sized to take up the\r
entire heap space, minus the space taken by pxEnd. */\r
pxFirstFreeBlock = ( void * ) pucAlignedHeap;\r
pxEnd->xBlockSize = 0;\r
pxEnd->pxNextFreeBlock = NULL;\r
\r
/* To start with there is a single free block that is sized to take up the\r
entire heap space, minus the space taken by pxEnd. */\r
pxFirstFreeBlock = ( void * ) pucAlignedHeap;\r
pxFirstFreeBlock->pxNextFreeBlock = pxEnd;\r
\r
/* Only one block exists - and it covers the entire usable heap space. */\r
pxFirstFreeBlock->pxNextFreeBlock = pxEnd;\r
\r
/* Only one block exists - and it covers the entire usable heap space. */\r