VirtualBox

Changeset 41898 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 23, 2012 6:44:29 PM (13 years ago)
Author:
vboxsync
Message:

patmRemovePatchFromPage: No need to move the whole array up one entry, just move the last entry. It's not like this is sorted or anything.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PATM.cpp

    r41897 r41898  
    46784678            {
    46794679                /* close the gap between the remaining pointers. */
    4680                 uint32_t cAfter = pPatchPage->cCount - i - 1;
    4681                 if (cAfter)
    4682                     memmove(&pPatchPage->papPatch[i], &pPatchPage->papPatch[i + 1], sizeof(pPatchPage->papPatch[i]) * cAfter);
    4683                 pPatchPage->papPatch[--pPatchPage->cCount] = NULL;
     4680                uint32_t cNew = --pPatchPage->cCount;
     4681                if (i < cNew)
     4682                    pPatchPage->papPatch[i] = pPatchPage->papPatch[cNew];
     4683                pPatchPage->papPatch[cNew] = NULL;
    46844684                return VINF_SUCCESS;
    46854685            }
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