VirtualBox

Ignore:
Timestamp:
Mar 31, 2009 8:36:22 AM (16 years ago)
Author:
vboxsync
Message:

Warnings: move assertion statements for parameters past initial declarations to silence -Wdeclaration-after-statement.
Correct some typos in comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/alloc/heapsimple.cpp

    r18428 r18561  
    8383/** The magic value. */
    8484#define RTHEAPSIMPLEBLOCK_FLAGS_MAGIC       ((uintptr_t)0xabcdef00)
    85 /** The mask that needs to be applied to RTHEAPSIMPLEBLOCK::fFalgs to obtain the magic value. */
     85/** The mask that needs to be applied to RTHEAPSIMPLEBLOCK::fFlags to obtain the magic value. */
    8686#define RTHEAPSIMPLEBLOCK_FLAGS_MAGIC_MASK  (~(uintptr_t)RT_BIT(0))
    8787
     
    301301
    302302    /*
    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.
    304304     */
    305305    AssertReturn(cbMemory >= PAGE_SIZE, VERR_INVALID_PARAMETER);
     
    450450 * Allocates a block of memory from the specified heap.
    451451 *
    452  * No parameter validation or adjustment is preformed.
     452 * No parameter validation or adjustment is performed.
    453453 *
    454454 * @returns Pointer to the allocated block.
     
    460460static PRTHEAPSIMPLEBLOCK rtHeapSimpleAllocBlock(PRTHEAPSIMPLEINTERNAL pHeapInt, size_t cb, size_t uAlignment)
    461461{
     462    /*
     463     * Search for a fitting block from the lower end of the heap.
     464     */
     465    PRTHEAPSIMPLEBLOCK  pRet = NULL;
     466    PRTHEAPSIMPLEFREE   pFree;
    462467#ifdef RTHEAPSIMPLE_STRICT
    463468    rtHeapSimpleAssertAll(pHeapInt);
    464469#endif
    465470
    466     /*
    467      * Search for a fitting block from the lower end of the heap.
    468      */
    469     PRTHEAPSIMPLEBLOCK  pRet = NULL;
    470     PRTHEAPSIMPLEFREE   pFree;
    471471    for (pFree = pHeapInt->pFreeHead;
    472472         pFree;
     
    524524
    525525            /*
    526              * Recreate pFree in the new position and adjust the neighbours.
     526             * Recreate pFree in the new position and adjust the neighbors.
    527527             */
    528528            *pFree = Free;
     
    667667
    668668/**
    669  * Free memory a memory block.
     669 * Free a memory block.
    670670 *
    671671 * @param   pHeapInt       The heap.
     
    676676    PRTHEAPSIMPLEFREE   pFree = (PRTHEAPSIMPLEFREE)pBlock;
    677677
     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;
    678684#ifdef RTHEAPSIMPLE_STRICT
    679685    rtHeapSimpleAssertAll(pHeapInt);
    680686#endif
    681687
    682     /*
    683      * Look for the closest free list blocks by walking the blocks right
    684      * of us (both list are sorted on address).
    685      */
    686     PRTHEAPSIMPLEFREE   pLeft = NULL;
    687     PRTHEAPSIMPLEFREE   pRight = NULL;
    688688    if (pHeapInt->pFreeTail)
    689689    {
     
    789789#ifdef RTHEAPSIMPLE_STRICT
    790790/**
    791  * Internal consitency check (relying on assertions).
     791 * Internal consistency check (relying on assertions).
    792792 * @param   pHeapInt
    793793 */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette