VirtualBox

Changeset 54117 in vbox


Ignore:
Timestamp:
Feb 9, 2015 5:08:28 PM (10 years ago)
Author:
vboxsync
Message:

don't check for VALID_PTR after RTMem*Alloc(), that's overkill

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/coreaudio.c

    r44529 r54117  
    300300        return err;
    301301    pRange = RTMemAllocZ(cSize);
    302     if (RT_VALID_PTR(pRange))
     302    if (pRange)
    303303    {
    304304        err = AudioDeviceGetProperty(device,
  • trunk/src/VBox/Storage/VD.cpp

    r53624 r54117  
    30373037                 */
    30383038                PRTSGBUF pTmp = (PRTSGBUF)RTMemAlloc(cbPreRead + cbThisWrite + cbPostRead + sizeof(RTSGSEG) + sizeof(RTSGBUF));
    3039                 AssertBreakStmt(VALID_PTR(pTmp), rc = VERR_NO_MEMORY);
     3039                AssertBreakStmt(pTmp, rc = VERR_NO_MEMORY);
    30403040                PRTSGSEG pSeg = (PRTSGSEG)(pTmp + 1);
    30413041
  • trunk/src/VBox/Storage/VDI.cpp

    r50988 r54117  
    24272427        {
    24282428            pvBuf = RTMemTmpAlloc(cbBlock);
    2429             AssertBreakStmt(VALID_PTR(pvBuf), rc = VERR_NO_MEMORY);
     2429            AssertBreakStmt(pvBuf, rc = VERR_NO_MEMORY);
    24302430        }
    24312431        pvTmp = RTMemTmpAlloc(cbBlock);
    2432         AssertBreakStmt(VALID_PTR(pvTmp), rc = VERR_NO_MEMORY);
     2432        AssertBreakStmt(pvTmp, rc = VERR_NO_MEMORY);
    24332433
    24342434        uint64_t cbFile;
     
    24452445        /* Allocate block array for back resolving. */
    24462446        paBlocks2 = (unsigned *)RTMemAlloc(sizeof(unsigned *) * cBlocksAllocated);
    2447         AssertBreakStmt(VALID_PTR(paBlocks2), rc = VERR_NO_MEMORY);
     2447        AssertBreakStmt(paBlocks2, rc = VERR_NO_MEMORY);
    24482448        /* Fill out back resolving, check/fix allocation errors before
    24492449         * compacting the image, just to be on the safe side. Update the
  • trunk/src/VBox/Storage/VHD.cpp

    r52695 r54117  
    24622462        {
    24632463            pvParent = RTMemTmpAlloc(pImage->cbDataBlock);
    2464             AssertBreakStmt(VALID_PTR(pvParent), rc = VERR_NO_MEMORY);
     2464            AssertBreakStmt(pvParent, rc = VERR_NO_MEMORY);
    24652465        }
    24662466        pvBuf = RTMemTmpAlloc(pImage->cbDataBlock);
    2467         AssertBreakStmt(VALID_PTR(pvBuf), rc = VERR_NO_MEMORY);
     2467        AssertBreakStmt(pvBuf, rc = VERR_NO_MEMORY);
    24682468
    24692469        unsigned cBlocksAllocated = 0;
     
    24902490
    24912491        paBlocks = (uint32_t *)RTMemTmpAllocZ(cBlocksAllocated * sizeof(uint32_t));
    2492         AssertBreakStmt(VALID_PTR(paBlocks), rc = VERR_NO_MEMORY);
     2492        AssertBreakStmt(paBlocks, rc = VERR_NO_MEMORY);
    24932493
    24942494        /* Invalidate the back resolving array. */
     
    25722572            RTMemTmpFree(pvBuf);
    25732573            pvBuf = RTMemTmpAllocZ(cbBlock);
    2574             AssertBreakStmt(VALID_PTR(pvBuf), rc = VERR_NO_MEMORY);
     2574            AssertBreakStmt(pvBuf, rc = VERR_NO_MEMORY);
    25752575
    25762576            for (unsigned i = 0; i < cBlocksAllocated; i++)
  • trunk/src/VBox/Storage/VMDK.cpp

    r50988 r54117  
    564564    /* If we get here, there's no matching entry in the cache. */
    565565    pVmdkFile = (PVMDKFILE)RTMemAllocZ(sizeof(VMDKFILE));
    566     if (!VALID_PTR(pVmdkFile))
     566    if (!pVmdkFile)
    567567    {
    568568        *ppVmdkFile = NULL;
     
    571571
    572572    pVmdkFile->pszFilename = RTStrDup(pszFilename);
    573     if (!VALID_PTR(pVmdkFile->pszFilename))
     573    if (!pVmdkFile->pszFilename)
    574574    {
    575575        RTMemFree(pVmdkFile);
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