VirtualBox

Ignore:
Timestamp:
Nov 6, 2021 3:10:49 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTR0MemObj: Added RTR0MemObjWasZeroInitialized and a couple of flags with which the backend can feed it the necessary info. It would be good to try avoid zeroing memory twice when we can. bugref:10093

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp

    r91483 r92246  
    283283                        if (pMemNt)
    284284                        {
     285                            pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC;
    285286                            pMemNt->fAllocatedPagesForMdl = true;
    286287                            pMemNt->cMdls = 1;
     
    333334            if (pMemNt)
    334335            {
     336                pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_UNINITIALIZED_AT_ALLOC;
    335337                pMemNt->cMdls = 1;
    336338                pMemNt->apMdls[0] = pMdl;
     
    441443                        if (pMemNt)
    442444                        {
     445                            pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC;
    443446                            pMemNt->fAllocatedPagesForMdl = true;
    444447                            pMemNt->cMdls = 1;
     
    525528                        if (pMemNt)
    526529                        {
     530                            pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC;
    527531                            pMemNt->fAllocatedPagesForMdl = true;
    528532                            pMemNt->cMdls = 1;
     
    607611        if (pMemNt)
    608612        {
     613            pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_UNINITIALIZED_AT_ALLOC;
    609614            pMemNt->Core.u.Cont.Phys = (RTHCPHYS)*MmGetMdlPfnArray(pMdl) << PAGE_SHIFT;
    610615            pMemNt->cMdls = 1;
     
    668673                    if (pMemNt)
    669674                    {
     675                        pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC;
    670676                        pMemNt->Core.u.Phys.fAllocated = true;
    671677                        pMemNt->Core.u.Phys.PhysBase = (RTHCPHYS)paPfns[0] << PAGE_SHIFT;
     
    705711                if (pMemNt)
    706712                {
     713                    pMemNt->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC;
    707714                    pMemNt->fAllocatedPagesForMdl = true;
    708715                    pMemNt->cMdls = 1;
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