]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/MemMang/heap_4.c
FreeRTOS source:
[freertos] / FreeRTOS / Source / portable / MemMang / heap_4.c
index cdce55af041d3d323e30ff16bbdc6b7f136ff0f1..b89cadbc42de6d295f34964805d9f5432a11709e 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.2 - Copyright (C) 2015 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -88,7 +88,7 @@ task.h is included from an application file. */
 #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
 \r
 /* Block sizes must not get too small. */\r
-#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize * 2 ) )\r
+#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) )\r
 \r
 /* Assumes 8bit bytes! */\r
 #define heapBITS_PER_BYTE              ( ( size_t ) 8 )\r
@@ -130,7 +130,7 @@ static void prvHeapInit( void );
 \r
 /* The size of the structure placed at the beginning of each allocated memory\r
 block must by correctly byte aligned. */\r
-static const size_t xHeapStructSize    = ( ( sizeof( BlockLink_t ) + ( ( ( size_t ) portBYTE_ALIGNMENT_MASK ) - ( size_t ) 1 ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ) );\r
+static const size_t xHeapStructSize    = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\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
@@ -229,7 +229,7 @@ void *pvReturn = NULL;
                                                cast is used to prevent byte alignment warnings from the\r
                                                compiler. */\r
                                                pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );\r
-                                               configASSERT( ( ( ( uint32_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );\r
+                                               configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );\r
 \r
                                                /* Calculate the sizes of two blocks split from the\r
                                                single block. */\r
@@ -237,7 +237,7 @@ void *pvReturn = NULL;
                                                pxBlock->xBlockSize = xWantedSize;\r
 \r
                                                /* Insert the new block into the list of free blocks. */\r
-                                               prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );\r
+                                               prvInsertBlockIntoFreeList( pxNewBlockLink );\r
                                        }\r
                                        else\r
                                        {\r