VirtualBox

Changeset 30826 in vbox


Ignore:
Timestamp:
Jul 14, 2010 12:48:26 PM (15 years ago)
Author:
vboxsync
Message:

RTAvllU32DoWithAll does deal with equal nodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r30823 r30826  
    32723272static DECLCALLBACK(int) pgmR3PhysChunkUnmapCandidateCallback(PAVLLU32NODECORE pNode, void *pvUser)
    32733273{
    3274     do
    3275     {
    3276         PPGMCHUNKR3MAP pChunk = (PPGMCHUNKR3MAP)((uint8_t *)pNode - RT_OFFSETOF(PGMCHUNKR3MAP, AgeCore));
    3277         if (    pChunk->iAge
    3278             &&  !pChunk->cRefs)
    3279         {
    3280             /*
    3281              * Check that it's not in any of the TLBs.
    3282              */
    3283             PVM pVM = ((PPGMR3PHYSCHUNKUNMAPCB)pvUser)->pVM;
    3284             for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.ChunkR3Map.Tlb.aEntries); i++)
    3285                 if (pVM->pgm.s.ChunkR3Map.Tlb.aEntries[i].pChunk == pChunk)
     3274    PPGMCHUNKR3MAP pChunk = (PPGMCHUNKR3MAP)((uint8_t *)pNode - RT_OFFSETOF(PGMCHUNKR3MAP, AgeCore));
     3275    if (    pChunk->iAge
     3276        &&  !pChunk->cRefs)
     3277    {
     3278        /*
     3279            * Check that it's not in any of the TLBs.
     3280            */
     3281        PVM pVM = ((PPGMR3PHYSCHUNKUNMAPCB)pvUser)->pVM;
     3282        for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.ChunkR3Map.Tlb.aEntries); i++)
     3283            if (pVM->pgm.s.ChunkR3Map.Tlb.aEntries[i].pChunk == pChunk)
     3284            {
     3285                pChunk = NULL;
     3286                break;
     3287            }
     3288        if (pChunk)
     3289            for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbHC.aEntries); i++)
     3290                if (pVM->pgm.s.PhysTlbHC.aEntries[i].pMap == pChunk)
    32863291                {
    32873292                    pChunk = NULL;
    32883293                    break;
    32893294                }
    3290             if (pChunk)
    3291                 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbHC.aEntries); i++)
    3292                     if (pVM->pgm.s.PhysTlbHC.aEntries[i].pMap == pChunk)
    3293                     {
    3294                         pChunk = NULL;
    3295                         break;
    3296                     }
    3297             if (pChunk)
    3298             {
    3299                 ((PPGMR3PHYSCHUNKUNMAPCB)pvUser)->pChunk = pChunk;
    3300                 return 1; /* done */
    3301             }
    3302         }
    3303 
    3304         /* next with the same age - this version of the AVL API doesn't enumerate the list, so we have to do it. */
    3305         pNode = pNode->pList;
    3306     } while (pNode);
     3295        if (pChunk)
     3296        {
     3297            ((PPGMR3PHYSCHUNKUNMAPCB)pvUser)->pChunk = pChunk;
     3298            return 1; /* done */
     3299        }
     3300    }
     3301
    33073302    return 0;
    33083303}
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