VirtualBox

Changeset 28273 in vbox


Ignore:
Timestamp:
Apr 13, 2010 7:38:54 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60015
Message:

alloc-ef.cpp: spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/alloc-ef.cpp

    r28271 r28273  
    323323         * and then change the page protection of the fence.
    324324         */
    325         #ifdef RTALLOC_EFENCE_IN_FRONT
     325#ifdef RTALLOC_EFENCE_IN_FRONT
    326326        void *pvEFence = pvBlock;
    327327        void *pv = (char *)pvEFence + RTALLOC_EFENCE_SIZE;
     
    329329        memset((char *)pv + cb, RTALLOC_EFENCE_NOMAN_FILLER, cbBlock - RTALLOC_EFENCE_SIZE - cb);
    330330# endif
    331         #else
     331#else
    332332        void *pvEFence = (char *)pvBlock + (cbBlock - RTALLOC_EFENCE_SIZE);
    333333        void *pv = (char *)pvEFence - cbAligned;
     
    336336        memset((char *)pv + cb, RTALLOC_EFENCE_NOMAN_FILLER, cbAligned - cb);
    337337# endif
    338         #endif
     338#endif
    339339
    340340#ifdef RTALLOC_EFENCE_FENCE_FILLER
     
    344344        if (!rc)
    345345        {
    346             #ifdef RTALLOC_EFENCE_TRACE
     346#ifdef RTALLOC_EFENCE_TRACE
    347347            rtmemBlockInsert(pBlock, pv);
    348             #endif
     348#endif
    349349            if (enmType == RTMEMTYPE_RTMEMALLOCZ)
    350350                memset(pv, 0, cb);
     
    398398            RTLogPrintf("RTMem %s: pv=%p pvCaller=%p cb=%#x\n", pszOp, pv, pvCaller, pBlock->cb);
    399399
    400 #ifdef RTALLOC_EFENCE_NOMAN_FILLER
     400# ifdef RTALLOC_EFENCE_NOMAN_FILLER
    401401        /*
    402402         * Check whether the no man's land is untouched.
    403403         */
    404 # ifdef RTALLOC_EFENCE_IN_FRONT
     404#  ifdef RTALLOC_EFENCE_IN_FRONT
    405405        void *pvWrong = ASMMemIsAll8((char *)pv + pBlock->cb,
    406406                                     RT_ALIGN_Z(pBlock->cb, PAGE_SIZE) - pBlock->cb,
    407407                                     RTALLOC_EFENCE_NOMAN_FILLER);
    408 # else
     408#  else
    409409        /* Alignment must match allocation alignment in rtMemAlloc(). */
    410410        size_t cbAligned = RT_ALIGN_Z(pBlock->cb, RTALLOC_EFENCE_ALIGNMENT);
     
    417417                               RT_ALIGN_Z(cbAligned, PAGE_SIZE) - cbAligned,
    418418                               RTALLOC_EFENCE_NOMAN_FILLER);
    419 # endif
     419#  endif
    420420        if (pvWrong)
    421421            RTAssertDoPanic();
    422 #endif
    423 
    424     #ifdef RTALLOC_EFENCE_FREE_FILL
     422# endif
     423
     424# ifdef RTALLOC_EFENCE_FREE_FILL
    425425        /*
    426426         * Fill the user part of the block.
    427427         */
    428428        memset(pv, RTALLOC_EFENCE_FREE_FILL, pBlock->cb);
    429     #endif
    430 
    431     #if defined(RTALLOC_EFENCE_FREE_DELAYED) && RTALLOC_EFENCE_FREE_DELAYED > 0
     429# endif
     430
     431# if defined(RTALLOC_EFENCE_FREE_DELAYED) && RTALLOC_EFENCE_FREE_DELAYED > 0
    432432        /*
    433433         * We're doing delayed freeing.
     
    444444            {
    445445                pv = pBlock->Core.Key;
    446                 #ifdef RTALLOC_EFENCE_IN_FRONT
     446ifdef RTALLOC_EFENCE_IN_FRONT
    447447                void *pvBlock = (char *)pv - RTALLOC_EFENCE_SIZE;
    448                 #else
     448else
    449449                void *pvBlock = (void *)((uintptr_t)pv & ~PAGE_OFFSET_MASK);
    450                 #endif
     450endif
    451451                size_t cbBlock = RT_ALIGN_Z(pBlock->cb, PAGE_SIZE) + RTALLOC_EFENCE_SIZE;
    452452                rc = RTMemProtect(pvBlock, cbBlock, RTMEM_PROT_READ | RTMEM_PROT_WRITE);
     
    461461            rtmemComplain(pszOp, "Failed to expand the efence of pv=%p cb=%d, rc=%d.\n", pv, pBlock, rc);
    462462
    463     #else /* !RTALLOC_EFENCE_FREE_DELAYED */
     463# else /* !RTALLOC_EFENCE_FREE_DELAYED */
    464464
    465465        /*
    466466         * Turn of the E-fence and free it.
    467467         */
    468         #ifdef RTALLOC_EFENCE_IN_FRONT
     468ifdef RTALLOC_EFENCE_IN_FRONT
    469469        void *pvBlock = (char *)pv - RTALLOC_EFENCE_SIZE;
    470470        void *pvEFence = pvBlock;
    471         #else
     471else
    472472        void *pvBlock = (void *)((uintptr_t)pv & ~PAGE_OFFSET_MASK);
    473473        void *pvEFence = (char *)pv + pBlock->cb;
    474         #endif
     474endif
    475475        int rc = RTMemProtect(pvEFence, RTALLOC_EFENCE_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE);
    476476        if (RT_SUCCESS(rc))
     
    480480        rtmemBlockFree(pBlock);
    481481
    482     #endif /* !RTALLOC_EFENCE_FREE_DELAYED */
     482# endif /* !RTALLOC_EFENCE_FREE_DELAYED */
    483483    }
    484484    else
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