Changeset 18561 in vbox for trunk/src/VBox/Runtime/common/alloc
- Timestamp:
- Mar 31, 2009 8:36:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/alloc/heapsimple.cpp
r18428 r18561 83 83 /** The magic value. */ 84 84 #define RTHEAPSIMPLEBLOCK_FLAGS_MAGIC ((uintptr_t)0xabcdef00) 85 /** The mask that needs to be applied to RTHEAPSIMPLEBLOCK::fF algs to obtain the magic value. */85 /** The mask that needs to be applied to RTHEAPSIMPLEBLOCK::fFlags to obtain the magic value. */ 86 86 #define RTHEAPSIMPLEBLOCK_FLAGS_MAGIC_MASK (~(uintptr_t)RT_BIT(0)) 87 87 … … 301 301 302 302 /* 303 * Validate input. The imposed minimum heap size is just a convenien value.303 * Validate input. The imposed minimum heap size is just a convenient value. 304 304 */ 305 305 AssertReturn(cbMemory >= PAGE_SIZE, VERR_INVALID_PARAMETER); … … 450 450 * Allocates a block of memory from the specified heap. 451 451 * 452 * No parameter validation or adjustment is p reformed.452 * No parameter validation or adjustment is performed. 453 453 * 454 454 * @returns Pointer to the allocated block. … … 460 460 static PRTHEAPSIMPLEBLOCK rtHeapSimpleAllocBlock(PRTHEAPSIMPLEINTERNAL pHeapInt, size_t cb, size_t uAlignment) 461 461 { 462 /* 463 * Search for a fitting block from the lower end of the heap. 464 */ 465 PRTHEAPSIMPLEBLOCK pRet = NULL; 466 PRTHEAPSIMPLEFREE pFree; 462 467 #ifdef RTHEAPSIMPLE_STRICT 463 468 rtHeapSimpleAssertAll(pHeapInt); 464 469 #endif 465 470 466 /*467 * Search for a fitting block from the lower end of the heap.468 */469 PRTHEAPSIMPLEBLOCK pRet = NULL;470 PRTHEAPSIMPLEFREE pFree;471 471 for (pFree = pHeapInt->pFreeHead; 472 472 pFree; … … 524 524 525 525 /* 526 * Recreate pFree in the new position and adjust the neighbo urs.526 * Recreate pFree in the new position and adjust the neighbors. 527 527 */ 528 528 *pFree = Free; … … 667 667 668 668 /** 669 * Free memorya memory block.669 * Free a memory block. 670 670 * 671 671 * @param pHeapInt The heap. … … 676 676 PRTHEAPSIMPLEFREE pFree = (PRTHEAPSIMPLEFREE)pBlock; 677 677 678 /* 679 * Look for the closest free list blocks by walking the blocks right 680 * of us (both lists are sorted by address). 681 */ 682 PRTHEAPSIMPLEFREE pLeft = NULL; 683 PRTHEAPSIMPLEFREE pRight = NULL; 678 684 #ifdef RTHEAPSIMPLE_STRICT 679 685 rtHeapSimpleAssertAll(pHeapInt); 680 686 #endif 681 687 682 /*683 * Look for the closest free list blocks by walking the blocks right684 * of us (both list are sorted on address).685 */686 PRTHEAPSIMPLEFREE pLeft = NULL;687 PRTHEAPSIMPLEFREE pRight = NULL;688 688 if (pHeapInt->pFreeTail) 689 689 { … … 789 789 #ifdef RTHEAPSIMPLE_STRICT 790 790 /** 791 * Internal consi tency check (relying on assertions).791 * Internal consistency check (relying on assertions). 792 792 * @param pHeapInt 793 793 */
Note:
See TracChangeset
for help on using the changeset viewer.