]> git.sur5r.net Git - freertos/blob - FreeRTOS/Source/portable/MemMang/heap_5.c
832c726f2288cc468bf8a858d0637b2cf94d80d8
[freertos] / FreeRTOS / Source / portable / MemMang / heap_5.c
1 /*\r
2     FreeRTOS V9.0.0rc1 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70 /*\r
71  * A sample implementation of pvPortMalloc() that allows the heap to be defined\r
72  * across multiple non-contigous blocks and combines (coalescences) adjacent\r
73  * memory blocks as they are freed.\r
74  *\r
75  * See heap_1.c, heap_2.c, heap_3.c and heap_4.c for alternative\r
76  * implementations, and the memory management pages of http://www.FreeRTOS.org\r
77  * for more information.\r
78  *\r
79  * Usage notes:\r
80  *\r
81  * vPortDefineHeapRegions() ***must*** be called before pvPortMalloc().\r
82  * pvPortMalloc() will be called if any task objects (tasks, queues, event\r
83  * groups, etc.) are created, therefore vPortDefineHeapRegions() ***must*** be\r
84  * called before any other objects are defined.\r
85  *\r
86  * vPortDefineHeapRegions() takes a single parameter.  The parameter is an array\r
87  * of HeapRegion_t structures.  HeapRegion_t is defined in portable.h as\r
88  *\r
89  * typedef struct HeapRegion\r
90  * {\r
91  *      uint8_t *pucStartAddress; << Start address of a block of memory that will be part of the heap.\r
92  *      size_t xSizeInBytes;      << Size of the block of memory.\r
93  * } HeapRegion_t;\r
94  *\r
95  * The array is terminated using a NULL zero sized region definition, and the\r
96  * memory regions defined in the array ***must*** appear in address order from\r
97  * low address to high address.  So the following is a valid example of how\r
98  * to use the function.\r
99  *\r
100  * HeapRegion_t xHeapRegions[] =\r
101  * {\r
102  *      { ( uint8_t * ) 0x80000000UL, 0x10000 }, << Defines a block of 0x10000 bytes starting at address 0x80000000\r
103  *      { ( uint8_t * ) 0x90000000UL, 0xa0000 }, << Defines a block of 0xa0000 bytes starting at address of 0x90000000\r
104  *      { NULL, 0 }                << Terminates the array.\r
105  * };\r
106  *\r
107  * vPortDefineHeapRegions( xHeapRegions ); << Pass the array into vPortDefineHeapRegions().\r
108  *\r
109  * Note 0x80000000 is the lower address so appears in the array first.\r
110  *\r
111  */\r
112 #include <stdlib.h>\r
113 \r
114 /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining\r
115 all the API functions to use the MPU wrappers.  That should only be done when\r
116 task.h is included from an application file. */\r
117 #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
118 \r
119 #include "FreeRTOS.h"\r
120 #include "task.h"\r
121 \r
122 #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
123 \r
124 #if( configSUPPORT_DYNAMIC_ALLOCATION == 0 )\r
125         #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0\r
126 #endif\r
127 \r
128 /* Block sizes must not get too small. */\r
129 #define heapMINIMUM_BLOCK_SIZE  ( ( size_t ) ( xHeapStructSize << 1 ) )\r
130 \r
131 /* Assumes 8bit bytes! */\r
132 #define heapBITS_PER_BYTE               ( ( size_t ) 8 )\r
133 \r
134 /* Define the linked list structure.  This is used to link free blocks in order\r
135 of their memory address. */\r
136 typedef struct A_BLOCK_LINK\r
137 {\r
138         struct A_BLOCK_LINK *pxNextFreeBlock;   /*<< The next free block in the list. */\r
139         size_t xBlockSize;                                              /*<< The size of the free block. */\r
140 } BlockLink_t;\r
141 \r
142 /*-----------------------------------------------------------*/\r
143 \r
144 /*\r
145  * Inserts a block of memory that is being freed into the correct position in\r
146  * the list of free memory blocks.  The block being freed will be merged with\r
147  * the block in front it and/or the block behind it if the memory blocks are\r
148  * adjacent to each other.\r
149  */\r
150 static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert );\r
151 \r
152 /*-----------------------------------------------------------*/\r
153 \r
154 /* The size of the structure placed at the beginning of each allocated memory\r
155 block must by correctly byte aligned. */\r
156 static const size_t xHeapStructSize     = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\r
157 \r
158 /* Create a couple of list links to mark the start and end of the list. */\r
159 static BlockLink_t xStart, *pxEnd = NULL;\r
160 \r
161 /* Keeps track of the number of free bytes remaining, but says nothing about\r
162 fragmentation. */\r
163 static size_t xFreeBytesRemaining = 0U;\r
164 static size_t xMinimumEverFreeBytesRemaining = 0U;\r
165 \r
166 /* Gets set to the top bit of an size_t type.  When this bit in the xBlockSize\r
167 member of an BlockLink_t structure is set then the block belongs to the\r
168 application.  When the bit is free the block is still part of the free heap\r
169 space. */\r
170 static size_t xBlockAllocatedBit = 0;\r
171 \r
172 /*-----------------------------------------------------------*/\r
173 \r
174 void *pvPortMalloc( size_t xWantedSize )\r
175 {\r
176 BlockLink_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink;\r
177 void *pvReturn = NULL;\r
178 \r
179         /* The heap must be initialised before the first call to\r
180         prvPortMalloc(). */\r
181         configASSERT( pxEnd );\r
182 \r
183         vTaskSuspendAll();\r
184         {\r
185                 /* Check the requested block size is not so large that the top bit is\r
186                 set.  The top bit of the block size member of the BlockLink_t structure\r
187                 is used to determine who owns the block - the application or the\r
188                 kernel, so it must be free. */\r
189                 if( ( xWantedSize & xBlockAllocatedBit ) == 0 )\r
190                 {\r
191                         /* The wanted size is increased so it can contain a BlockLink_t\r
192                         structure in addition to the requested amount of bytes. */\r
193                         if( xWantedSize > 0 )\r
194                         {\r
195                                 xWantedSize += xHeapStructSize;\r
196 \r
197                                 /* Ensure that blocks are always aligned to the required number\r
198                                 of bytes. */\r
199                                 if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )\r
200                                 {\r
201                                         /* Byte alignment required. */\r
202                                         xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );\r
203                                 }\r
204                                 else\r
205                                 {\r
206                                         mtCOVERAGE_TEST_MARKER();\r
207                                 }\r
208                         }\r
209                         else\r
210                         {\r
211                                 mtCOVERAGE_TEST_MARKER();\r
212                         }\r
213 \r
214                         if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )\r
215                         {\r
216                                 /* Traverse the list from the start     (lowest address) block until\r
217                                 one     of adequate size is found. */\r
218                                 pxPreviousBlock = &xStart;\r
219                                 pxBlock = xStart.pxNextFreeBlock;\r
220                                 while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )\r
221                                 {\r
222                                         pxPreviousBlock = pxBlock;\r
223                                         pxBlock = pxBlock->pxNextFreeBlock;\r
224                                 }\r
225 \r
226                                 /* If the end marker was reached then a block of adequate size\r
227                                 was     not found. */\r
228                                 if( pxBlock != pxEnd )\r
229                                 {\r
230                                         /* Return the memory space pointed to - jumping over the\r
231                                         BlockLink_t structure at its start. */\r
232                                         pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );\r
233 \r
234                                         /* This block is being returned for use so must be taken out\r
235                                         of the list of free blocks. */\r
236                                         pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;\r
237 \r
238                                         /* If the block is larger than required it can be split into\r
239                                         two. */\r
240                                         if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )\r
241                                         {\r
242                                                 /* This block is to be split into two.  Create a new\r
243                                                 block following the number of bytes requested. The void\r
244                                                 cast is used to prevent byte alignment warnings from the\r
245                                                 compiler. */\r
246                                                 pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );\r
247 \r
248                                                 /* Calculate the sizes of two blocks split from the\r
249                                                 single block. */\r
250                                                 pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;\r
251                                                 pxBlock->xBlockSize = xWantedSize;\r
252 \r
253                                                 /* Insert the new block into the list of free blocks. */\r
254                                                 prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );\r
255                                         }\r
256                                         else\r
257                                         {\r
258                                                 mtCOVERAGE_TEST_MARKER();\r
259                                         }\r
260 \r
261                                         xFreeBytesRemaining -= pxBlock->xBlockSize;\r
262 \r
263                                         if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )\r
264                                         {\r
265                                                 xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;\r
266                                         }\r
267                                         else\r
268                                         {\r
269                                                 mtCOVERAGE_TEST_MARKER();\r
270                                         }\r
271 \r
272                                         /* The block is being returned - it is allocated and owned\r
273                                         by the application and has no "next" block. */\r
274                                         pxBlock->xBlockSize |= xBlockAllocatedBit;\r
275                                         pxBlock->pxNextFreeBlock = NULL;\r
276                                 }\r
277                                 else\r
278                                 {\r
279                                         mtCOVERAGE_TEST_MARKER();\r
280                                 }\r
281                         }\r
282                         else\r
283                         {\r
284                                 mtCOVERAGE_TEST_MARKER();\r
285                         }\r
286                 }\r
287                 else\r
288                 {\r
289                         mtCOVERAGE_TEST_MARKER();\r
290                 }\r
291 \r
292                 traceMALLOC( pvReturn, xWantedSize );\r
293         }\r
294         ( void ) xTaskResumeAll();\r
295 \r
296         #if( configUSE_MALLOC_FAILED_HOOK == 1 )\r
297         {\r
298                 if( pvReturn == NULL )\r
299                 {\r
300                         extern void vApplicationMallocFailedHook( void );\r
301                         vApplicationMallocFailedHook();\r
302                 }\r
303                 else\r
304                 {\r
305                         mtCOVERAGE_TEST_MARKER();\r
306                 }\r
307         }\r
308         #endif\r
309 \r
310         return pvReturn;\r
311 }\r
312 /*-----------------------------------------------------------*/\r
313 \r
314 void vPortFree( void *pv )\r
315 {\r
316 uint8_t *puc = ( uint8_t * ) pv;\r
317 BlockLink_t *pxLink;\r
318 \r
319         if( pv != NULL )\r
320         {\r
321                 /* The memory being freed will have an BlockLink_t structure immediately\r
322                 before it. */\r
323                 puc -= xHeapStructSize;\r
324 \r
325                 /* This casting is to keep the compiler from issuing warnings. */\r
326                 pxLink = ( void * ) puc;\r
327 \r
328                 /* Check the block is actually allocated. */\r
329                 configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );\r
330                 configASSERT( pxLink->pxNextFreeBlock == NULL );\r
331 \r
332                 if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 )\r
333                 {\r
334                         if( pxLink->pxNextFreeBlock == NULL )\r
335                         {\r
336                                 /* The block is being returned to the heap - it is no longer\r
337                                 allocated. */\r
338                                 pxLink->xBlockSize &= ~xBlockAllocatedBit;\r
339 \r
340                                 vTaskSuspendAll();\r
341                                 {\r
342                                         /* Add this block to the list of free blocks. */\r
343                                         xFreeBytesRemaining += pxLink->xBlockSize;\r
344                                         traceFREE( pv, pxLink->xBlockSize );\r
345                                         prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );\r
346                                 }\r
347                                 ( void ) xTaskResumeAll();\r
348                         }\r
349                         else\r
350                         {\r
351                                 mtCOVERAGE_TEST_MARKER();\r
352                         }\r
353                 }\r
354                 else\r
355                 {\r
356                         mtCOVERAGE_TEST_MARKER();\r
357                 }\r
358         }\r
359 }\r
360 /*-----------------------------------------------------------*/\r
361 \r
362 size_t xPortGetFreeHeapSize( void )\r
363 {\r
364         return xFreeBytesRemaining;\r
365 }\r
366 /*-----------------------------------------------------------*/\r
367 \r
368 size_t xPortGetMinimumEverFreeHeapSize( void )\r
369 {\r
370         return xMinimumEverFreeBytesRemaining;\r
371 }\r
372 /*-----------------------------------------------------------*/\r
373 \r
374 static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert )\r
375 {\r
376 BlockLink_t *pxIterator;\r
377 uint8_t *puc;\r
378 \r
379         /* Iterate through the list until a block is found that has a higher address\r
380         than the block being inserted. */\r
381         for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )\r
382         {\r
383                 /* Nothing to do here, just iterate to the right position. */\r
384         }\r
385 \r
386         /* Do the block being inserted, and the block it is being inserted after\r
387         make a contiguous block of memory? */\r
388         puc = ( uint8_t * ) pxIterator;\r
389         if( ( puc + pxIterator->xBlockSize ) == ( uint8_t * ) pxBlockToInsert )\r
390         {\r
391                 pxIterator->xBlockSize += pxBlockToInsert->xBlockSize;\r
392                 pxBlockToInsert = pxIterator;\r
393         }\r
394         else\r
395         {\r
396                 mtCOVERAGE_TEST_MARKER();\r
397         }\r
398 \r
399         /* Do the block being inserted, and the block it is being inserted before\r
400         make a contiguous block of memory? */\r
401         puc = ( uint8_t * ) pxBlockToInsert;\r
402         if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock )\r
403         {\r
404                 if( pxIterator->pxNextFreeBlock != pxEnd )\r
405                 {\r
406                         /* Form one big block from the two blocks. */\r
407                         pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize;\r
408                         pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock;\r
409                 }\r
410                 else\r
411                 {\r
412                         pxBlockToInsert->pxNextFreeBlock = pxEnd;\r
413                 }\r
414         }\r
415         else\r
416         {\r
417                 pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock;\r
418         }\r
419 \r
420         /* If the block being inserted plugged a gab, so was merged with the block\r
421         before and the block after, then it's pxNextFreeBlock pointer will have\r
422         already been set, and should not be set here as that would make it point\r
423         to itself. */\r
424         if( pxIterator != pxBlockToInsert )\r
425         {\r
426                 pxIterator->pxNextFreeBlock = pxBlockToInsert;\r
427         }\r
428         else\r
429         {\r
430                 mtCOVERAGE_TEST_MARKER();\r
431         }\r
432 }\r
433 /*-----------------------------------------------------------*/\r
434 \r
435 void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )\r
436 {\r
437 BlockLink_t *pxFirstFreeBlockInRegion = NULL, *pxPreviousFreeBlock;\r
438 size_t xAlignedHeap;\r
439 size_t xTotalRegionSize, xTotalHeapSize = 0;\r
440 BaseType_t xDefinedRegions = 0;\r
441 size_t xAddress;\r
442 const HeapRegion_t *pxHeapRegion;\r
443 \r
444         /* Can only call once! */\r
445         configASSERT( pxEnd == NULL );\r
446 \r
447         pxHeapRegion = &( pxHeapRegions[ xDefinedRegions ] );\r
448 \r
449         while( pxHeapRegion->xSizeInBytes > 0 )\r
450         {\r
451                 xTotalRegionSize = pxHeapRegion->xSizeInBytes;\r
452 \r
453                 /* Ensure the heap region starts on a correctly aligned boundary. */\r
454                 xAddress = ( size_t ) pxHeapRegion->pucStartAddress;\r
455                 if( ( xAddress & portBYTE_ALIGNMENT_MASK ) != 0 )\r
456                 {\r
457                         xAddress += ( portBYTE_ALIGNMENT - 1 );\r
458                         xAddress &= ~portBYTE_ALIGNMENT_MASK;\r
459 \r
460                         /* Adjust the size for the bytes lost to alignment. */\r
461                         xTotalRegionSize -= xAddress - ( size_t ) pxHeapRegion->pucStartAddress;\r
462                 }\r
463 \r
464                 xAlignedHeap = xAddress;\r
465 \r
466                 /* Set xStart if it has not already been set. */\r
467                 if( xDefinedRegions == 0 )\r
468                 {\r
469                         /* xStart is used to hold a pointer to the first item in the list of\r
470                         free blocks.  The void cast is used to prevent compiler warnings. */\r
471                         xStart.pxNextFreeBlock = ( BlockLink_t * ) xAlignedHeap;\r
472                         xStart.xBlockSize = ( size_t ) 0;\r
473                 }\r
474                 else\r
475                 {\r
476                         /* Should only get here if one region has already been added to the\r
477                         heap. */\r
478                         configASSERT( pxEnd != NULL );\r
479 \r
480                         /* Check blocks are passed in with increasing start addresses. */\r
481                         configASSERT( xAddress > ( size_t ) pxEnd );\r
482                 }\r
483 \r
484                 /* Remember the location of the end marker in the previous region, if\r
485                 any. */\r
486                 pxPreviousFreeBlock = pxEnd;\r
487 \r
488                 /* pxEnd is used to mark the end of the list of free blocks and is\r
489                 inserted at the end of the region space. */\r
490                 xAddress = xAlignedHeap + xTotalRegionSize;\r
491                 xAddress -= xHeapStructSize;\r
492                 xAddress &= ~portBYTE_ALIGNMENT_MASK;\r
493                 pxEnd = ( BlockLink_t * ) xAddress;\r
494                 pxEnd->xBlockSize = 0;\r
495                 pxEnd->pxNextFreeBlock = NULL;\r
496 \r
497                 /* To start with there is a single free block in this region that is\r
498                 sized to take up the entire heap region minus the space taken by the\r
499                 free block structure. */\r
500                 pxFirstFreeBlockInRegion = ( BlockLink_t * ) xAlignedHeap;\r
501                 pxFirstFreeBlockInRegion->xBlockSize = xAddress - ( size_t ) pxFirstFreeBlockInRegion;\r
502                 pxFirstFreeBlockInRegion->pxNextFreeBlock = pxEnd;\r
503 \r
504                 /* If this is not the first region that makes up the entire heap space\r
505                 then link the previous region to this region. */\r
506                 if( pxPreviousFreeBlock != NULL )\r
507                 {\r
508                         pxPreviousFreeBlock->pxNextFreeBlock = pxFirstFreeBlockInRegion;\r
509                 }\r
510 \r
511                 xTotalHeapSize += pxFirstFreeBlockInRegion->xBlockSize;\r
512 \r
513                 /* Move onto the next HeapRegion_t structure. */\r
514                 xDefinedRegions++;\r
515                 pxHeapRegion = &( pxHeapRegions[ xDefinedRegions ] );\r
516         }\r
517 \r
518         xMinimumEverFreeBytesRemaining = xTotalHeapSize;\r
519         xFreeBytesRemaining = xTotalHeapSize;\r
520 \r
521         /* Check something was actually defined before it is accessed. */\r
522         configASSERT( xTotalHeapSize );\r
523 \r
524         /* Work out the position of the top bit in a size_t variable. */\r
525         xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 );\r
526 }\r
527 \r