VirtualBox

Ignore:
Timestamp:
Sep 2, 2021 1:51:26 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146745
Message:

IPRT/vfsmemory.cpp: Moved the before-first-extent check down a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp

    r91091 r91095  
    172172    if (!pExtent || off < pExtent->off)
    173173    {
    174         /* Check whether the offset is before the first extent first. */
    175         pExtent = RTListGetFirst(&pThis->ExtentHead, RTVFSMEMEXTENT, Entry);
    176         if (   pExtent
    177             && off < pExtent->off)
    178         {
    179             *pfHit = false;
    180             return pExtent;
    181         }
    182 
    183174        /* Consider the last entry first (for writes). */
    184175        pExtent = RTListGetLast(&pThis->ExtentHead, RTVFSMEMEXTENT, Entry);
     
    195186        }
    196187
    197         /* Otherwise, start from the head. */
     188        /* Otherwise, start from the head after making sure it is not an
     189           offset before the first extent. */
    198190        pExtent = RTListGetFirst(&pThis->ExtentHead, RTVFSMEMEXTENT, Entry);
     191        if (off < pExtent->off)
     192        {
     193            *pfHit = false;
     194            return pExtent;
     195        }
    199196    }
    200197
Note: See TracChangeset for help on using the changeset viewer.

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