VirtualBox

Changeset 28317 in vbox


Ignore:
Timestamp:
Apr 14, 2010 6:06:05 PM (15 years ago)
Author:
vboxsync
Message:

RTMemPageFree + all users: Added size parameter to RTMemPageFree so we can avoid tracking structures when using mmap/munmap.

Location:
trunk/src
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp

    r28048 r28317  
    6969    void *pv = RTMemPageAlloc(PAGE_SIZE);
    7070    g_fSysMadviseWorks = madvise(pv, PAGE_SIZE, MADV_DONTFORK) == 0;
    71     RTMemPageFree(pv);
     71    RTMemPageFree(pv, PAGE_SIZE);
    7272#endif
    7373}
     
    148148#else
    149149
    150     RTMemPageFree(pu8);
     150    RTMemPageFree(pu8, cb);
    151151
    152152#endif
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp

    r21218 r28317  
    423423         */
    424424        uint32_t cb = _4K;
    425         int rc = VERR_NO_MEMORY;
    426         void *pv = RTMemPageAllocZ(cb);
     425        uint32_t cbAllocated = cb;
     426        int      rc = VERR_NO_MEMORY;
     427        void    *pv = RTMemPageAllocZ(cbAllocated);
    427428        if (pv)
    428429        {
     
    431432            if (rc == VINF_BUFFER_OVERFLOW)
    432433            {
    433                 RTMemPageFree(pv);
    434                 cb = RT_ALIGN_32(cb, PAGE_SIZE);
    435                 pv = RTMemPageAllocZ(cb);
     434                RTMemPageFree(pv, cbAllocated);
     435                cbAllocated = cb = RT_ALIGN_32(cb, PAGE_SIZE);
     436                pv = RTMemPageAllocZ(cbAllocated);
    436437                rc = VbglR3ClipboardReadData(g_u32ClientId, fFormat, pv, cb, &cb);
    437438            }
    438439            if (RT_FAILURE(rc))
    439                 RTMemPageFree(pv);
     440                RTMemPageFree(pv, cbAllocated);
    440441        }
    441442        if (RT_SUCCESS(rc))
     
    458459                }
    459460            }
    460             RTMemPageFree(pv);
     461            RTMemPageFree(pv, cbAllocated);
    461462        }
    462463        else
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r26430 r28317  
    11841184    if (RT_UNLIKELY(g_u32FakeMode))
    11851185    {
    1186         RTMemPageFree(pvPages);
     1186        RTMemPageFree(pvPages, cPages * PAGE_SIZE);
    11871187        return VINF_SUCCESS;
    11881188    }
    11891189
    11901190    /*
    1191      * Try normal free first, then if it fails check if we're using the fallback                                            .
     1191     * Try normal free first, then if it fails check if we're using the fallback
    11921192     * for the allocations without kernel mappings and attempt unlocking it.
    11931193     */
     
    12821282    if (RT_UNLIKELY(g_u32FakeMode))
    12831283    {
    1284         RTMemPageFree(pv);
     1284        RTMemPageFree(pv, cPages * PAGE_SIZE);
    12851285        return VINF_SUCCESS;
    12861286    }
     
    13851385    if (RT_UNLIKELY(g_u32FakeMode))
    13861386    {
    1387         RTMemPageFree(pv);
     1387        RTMemPageFree(pv, cPages * PAGE_SIZE);
    13881388        return VINF_SUCCESS;
    13891389    }
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp

    r22077 r28317  
    186186
    187187
    188 int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t /* cPages */)
     188int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages)
    189189{
    190190    NOREF(pThis);
    191     RTMemPageFree(pvPages);
     191    RTMemPageFree(pvPages, cPages * PAGE_SIZE);
    192192    return VINF_SUCCESS;
    193193}
  • trunk/src/VBox/Runtime/Makefile.kmk

    r28303 r28317  
    16571657 RuntimeRC_INCS          = include
    16581658 RuntimeRC_SOURCES       = \
     1659        common/checksum/crc32.cpp \
     1660        common/checksum/crc64.cpp \
     1661        common/checksum/md5.cpp \
    16591662        common/log/log.cpp \
    16601663        common/log/logellipsis.cpp \
  • trunk/src/VBox/Runtime/common/alloc/memcache.cpp

    r26525 r28317  
    252252        }
    253253
    254         RTMemPageFree(pPage);
     254        RTMemPageFree(pPage, PAGE_SIZE);
    255255    }
    256256
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r28271 r28317  
    4848#include "internal/magics.h"
    4949#include "internal/thread.h"
     50
    5051
    5152/*******************************************************************************
  • trunk/src/VBox/Runtime/r3/alloc-ef.cpp

    r28298 r28317  
    363363        }
    364364        rtmemComplain(pszOp, "RTMemProtect failed, pvEFence=%p size %d, rc=%d\n", pvEFence, RTALLOC_EFENCE_SIZE, rc);
    365         RTMemPageFree(pvBlock);
     365        RTMemPageFree(pvBlock, cbBlock);
    366366    }
    367367    else
     
    456456                rc = RTMemProtect(pvBlock, cbBlock, RTMEM_PROT_READ | RTMEM_PROT_WRITE);
    457457                if (RT_SUCCESS(rc))
    458                     RTMemPageFree(pvBlock);
     458                    RTMemPageFree(pvBlock, RT_ALIGN_Z(pBlock->cbAligned, PAGE_SIZE) + RTALLOC_EFENCE_SIZE);
    459459                else
    460460                    rtmemComplain(pszOp, "RTMemProtect(%p, %#x, RTMEM_PROT_READ | RTMEM_PROT_WRITE) -> %d\n", pvBlock, cbBlock, rc);
     
    479479        int rc = RTMemProtect(pvEFence, RTALLOC_EFENCE_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE);
    480480        if (RT_SUCCESS(rc))
    481             RTMemPageFree(pvBlock);
     481            RTMemPageFree(pvBlock, RT_ALIGN_Z(pBlock->cbAligned, PAGE_SIZE) + RTALLOC_EFENCE_SIZE);
    482482        else
    483483            rtmemComplain(pszOp, "RTMemProtect(%p, %#x, RTMEM_PROT_READ | RTMEM_PROT_WRITE) -> %d\n", pvEFence, RTALLOC_EFENCE_SIZE, rc);
  • trunk/src/VBox/Runtime/r3/darwin/alloc-darwin.cpp

    r27492 r28317  
    126126 *                  NULL will be ignored.
    127127 */
    128 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW
     128RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    129129{
    130130    if (pv)
  • trunk/src/VBox/Runtime/r3/freebsd/alloc-freebsd.cpp

    r21292 r28317  
    8484RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW
    8585{
    86     return RTMemPageFree(pv);
     86    if (pv)
     87        free(pv);
    8788}
    8889
     
    129130 *                  NULL will be ignored.
    130131 */
    131 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW
     132RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    132133{
    133134    if (pv)
  • trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp

    r28311 r28317  
    4444#include <sys/mman.h>
    4545
    46 #if !defined(RT_USE_MMAP) && (defined(RT_OS_LINUX))
    47 # define RT_USE_MMAP
    48 #endif
     46
     47/*******************************************************************************
     48*   Defined Constants And Macros                                               *
     49*******************************************************************************/
     50#if !defined(RT_USE_MMAP_EXEC) && (defined(RT_OS_LINUX))
     51# define RT_USE_MMAP_EXEC
     52#endif
     53
     54#if !defined(RT_USE_MMAP_PAGE) && 0 /** @todo mmap is too slow for full scale EF setup. */
     55# define RT_USE_MMAP_PAGE
     56#endif
     57
    4958
    5059/*******************************************************************************
    5160*   Structures and Typedefs                                                    *
    5261*******************************************************************************/
    53 #ifdef RT_USE_MMAP
     62#ifdef RT_USE_MMAP_EXEC
    5463/**
    5564 * RTMemExecAlloc() header used when using mmap for allocating the memory.
     
    6776
    6877/** Magic for RTMEMEXECHDR. */
    69 #define RTMEMEXECHDR_MAGIC (~(size_t)0xfeedbabe)
    70 
    71 #endif  /* RT_USE_MMAP */
     78# define RTMEMEXECHDR_MAGIC (~(size_t)0xfeedbabe)
     79
     80#endif  /* RT_USE_MMAP_EXEC */
    7281
    7382
     
    8493    AssertMsg(cb, ("Allocating ZERO bytes is really not a good idea! Good luck with the next assertion!\n"));
    8594
    86 #ifdef RT_USE_MMAP
     95#ifdef RT_USE_MMAP_EXEC
    8796    /*
    8897     * Use mmap to get low memory.
     
    9099    size_t cbAlloc = RT_ALIGN_Z(cb + sizeof(RTMEMEXECHDR), PAGE_SIZE);
    91100    void *pv = mmap(NULL, cbAlloc, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS
    92 #if defined(RT_ARCH_AMD64) && defined(MAP_32BIT)
     101# if defined(RT_ARCH_AMD64) && defined(MAP_32BIT)
    93102                    | MAP_32BIT
    94 #endif
     103# endif
    95104                    , -1, 0);
    96105    AssertMsgReturn(pv != MAP_FAILED, ("errno=%d cb=%#zx\n", errno, cb), NULL);
     
    142151    if (pv)
    143152    {
    144 #ifdef RT_USE_MMAP
     153#ifdef RT_USE_MMAP_EXEC
    145154        PRTMEMEXECHDR pHdr = (PRTMEMEXECHDR)pv - 1;
    146155        AssertMsgReturnVoid(RT_ALIGN_P(pHdr, PAGE_SIZE) == pHdr, ("pHdr=%p pv=%p\n", pHdr, pv));
     
    164173RTDECL(void *) RTMemPageAlloc(size_t cb) RT_NO_THROW
    165174{
    166 #if 0 /** @todo huh? we're using posix_memalign in the next function... */
     175#ifdef RT_USE_MMAP_PAGE
     176    size_t  cbAligned = RT_ALIGN_Z(cb, PAGE_SIZE);
     177    void   *pv = mmap(NULL, cbAligned, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
     178    AssertMsgReturn(pv != MAP_FAILED, ("errno=%d cb=%#zx\n", errno, cb), NULL);
     179    return pv;
     180
     181#else
     182# if 0 /** @todo huh? we're using posix_memalign in the next function... */
    167183    void *pv;
    168184    int rc = posix_memalign(&pv, PAGE_SIZE, RT_ALIGN_Z(cb, PAGE_SIZE));
     
    170186        return pv;
    171187    return NULL;
    172 #else
     188# else
    173189    return memalign(PAGE_SIZE, cb);
     190# endif
    174191#endif
    175192}
     
    185202RTDECL(void *) RTMemPageAllocZ(size_t cb) RT_NO_THROW
    186203{
     204#ifdef RT_USE_MMAP_PAGE
     205    size_t  cbAligned = RT_ALIGN_Z(cb, PAGE_SIZE);
     206    void   *pv = mmap(NULL, cbAligned, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
     207    AssertMsgReturn(pv != MAP_FAILED, ("errno=%d cb=%#zx\n", errno, cb), NULL);
     208    return pv;
     209
     210#else
    187211    void *pv;
    188212    int rc = posix_memalign(&pv, PAGE_SIZE, RT_ALIGN_Z(cb, PAGE_SIZE));
     
    193217    }
    194218    return NULL;
     219#endif
    195220}
    196221
     
    202227 *                  NULL will be ignored.
    203228 */
    204 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW
     229RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    205230{
    206231    if (pv)
     232    {
     233        Assert(!((uintptr_t)pv & PAGE_OFFSET_MASK));
     234
     235#ifdef RT_USE_MMAP_PAGE
     236        size_t cbAligned = RT_ALIGN_Z(cb, PAGE_SIZE);
     237        int rc = munmap(pv, cbAligned);
     238        AssertMsg(!rc, ("munmap(%p, %#zx) -> %d errno=%d\n", pv, cbAligned, rc, errno)); NOREF(rc);
     239#else
    207240        free(pv);
     241#endif
     242    }
    208243}
    209244
  • trunk/src/VBox/Runtime/r3/solaris/alloc-solaris.cpp

    r27492 r28317  
    133133 *                  NULL will be ignored.
    134134 */
    135 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW
     135RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    136136{
    137137    if (pv)
  • trunk/src/VBox/Runtime/r3/test.cpp

    r27649 r28317  
    529529            }
    530530
    531             RTMemPageFree(pMem->pvAlloc);
     531            RTMemPageFree(pMem->pvAlloc, pMem->cbAlloc);
    532532        }
    533533        RTMemFree(pMem);
     
    587587    rc = RTMemProtect(pMem->aGuards[0].pv, pMem->aGuards[0].cb, RTMEM_PROT_WRITE | RTMEM_PROT_READ); AssertRC(rc);
    588588    rc = RTMemProtect(pMem->aGuards[1].pv, pMem->aGuards[1].cb, RTMEM_PROT_WRITE | RTMEM_PROT_READ); AssertRC(rc);
    589     RTMemPageFree(pMem->pvAlloc);
     589    RTMemPageFree(pMem->pvAlloc, pMem->cbAlloc);
    590590    RTMemFree(pMem);
    591591}
  • trunk/src/VBox/Runtime/r3/win/alloc-win.cpp

    r21872 r28317  
    148148 *                  NULL will be ignored.
    149149 */
    150 RTDECL(void) RTMemPageFree(void *pv) RT_NO_THROW
     150RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
    151151{
    152152    if (pv)
  • trunk/src/VBox/Runtime/testcase/tstFileAio.cpp

    r25000 r28317  
    172172                        /* Free buffers. */
    173173                        for (unsigned i = 0; i < cMaxReqsInFlight; i++)
    174                             RTMemPageFree(papvBuf[i]);
     174                            RTMemPageFree(papvBuf[i], cbTestBuf);
    175175
    176176                        /* Free requests. */
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileCache.cpp

    r28065 r28317  
    368368                  ("Entry is dirty and/or still in progress fFlags=%#x\n", pEntry->fFlags));
    369369
    370         RTMemPageFree(pEntry->pbData);
     370        RTMemPageFree(pEntry->pbData, pEntry->cbData);
    371371        RTMemFree(pEntry);
    372372    }
     
    439439                }
    440440                else if (pCurr->pbData)
    441                     RTMemPageFree(pCurr->pbData);
     441                    RTMemPageFree(pCurr->pbData, pEntry->cbData);
    442442
    443443                pCurr->pbData = NULL;
     
    11721172        pdmacFileCacheSub(pCache, pEntry->cbData);
    11731173
    1174     RTMemPageFree(pEntry->pbData);
     1174    RTMemPageFree(pEntry->pbData, pEntry->cbData);
    11751175    RTMemFree(pEntry);
    11761176
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileInternal.h

    r28224 r28317  
    645645    /** Data segment. */
    646646    RTSGSEG                              DataSeg;
    647     /** Flag whether this segment uses a bounce buffer
    648      * because the provided buffer doesn't meet host requirements. */
    649     bool                                 fBounceBuffer;
     647    /** When non-zero the segment uses a bounce buffer because the provided buffer
     648     * doesn't meet host requirements. */
     649    size_t                               cbBounceBuffer;
    650650    /** Pointer to the used bounce buffer if any. */
    651651    void                                *pvBounceBuffer;
    652652    /** Start offset in the bounce buffer to copy from. */
    653     uint32_t                             uBounceBufOffset;
     653    uint32_t                             offBounceBuffer;
    654654    /** Flag whether this is a prefetch request. */
    655655    bool                                 fPrefetch;
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileNormal.cpp

    r28225 r28317  
    432432                    pAioMgr->iFreeEntryNext = (pAioMgr->iFreeEntryNext + 1) % pAioMgr->cReqEntries;
    433433
    434                     if (pTask->fBounceBuffer)
     434                    if (pTask->cbBounceBuffer)
    435435                        RTMemFree(pTask->pvBounceBuffer);
    436436
     
    450450                pAioMgr->cRequestsActiveMax = pAioMgr->cRequestsActive;
    451451            }
    452            
     452
    453453            LogFlow(("Removed requests. I/O manager has a total of %d active requests now\n", pAioMgr->cRequestsActive));
    454454            LogFlow(("Endpoint has a total of %d active requests now\n", pEndpoint->AioMgr.cRequestsActive));
     
    602602
    603603    pTask->fPrefetch = false;
    604     pTask->fBounceBuffer = false;
     604    pTask->cbBounceBuffer = 0;
    605605
    606606    /*
     
    721721
    722722            /* Create bounce buffer. */
    723             pTask->fBounceBuffer = true;
     723            pTask->cbBounceBuffer = cbToTransfer;
    724724
    725725            AssertMsg(pTask->Off >= offStart, ("Overflow in calculation Off=%llu offStart=%llu\n",
    726726                      pTask->Off, offStart));
    727             pTask->uBounceBufOffset = pTask->Off - offStart;
     727            pTask->offBounceBuffer = pTask->Off - offStart;
    728728
    729729            /** @todo: I think we need something like a RTMemAllocAligned method here.
     
    755755        }
    756756        else
    757             pTask->fBounceBuffer = false;
     757            pTask->cbBounceBuffer = 0;
    758758
    759759        if (RT_SUCCESS(rc))
     
    786786            {
    787787                /* Cleanup */
    788                 if (pTask->fBounceBuffer)
    789                     RTMemPageFree(pTask->pvBounceBuffer);
     788                if (pTask->cbBounceBuffer)
     789                    RTMemPageFree(pTask->pvBounceBuffer, pTask->cbBounceBuffer);
    790790            }
    791791        }
     
    11461146        pEndpoint->AioMgr.cReqsProcessed++;
    11471147
    1148         if (pTask->fBounceBuffer)
    1149             RTMemFree(pTask->pvBounceBuffer);
     1148        if (pTask->cbBounceBuffer)
     1149            RTMemPageFree(pTask->pvBounceBuffer, pTask->cbBounceBuffer);
    11501150
    11511151        /* Queue the request on the pending list. */
     
    11871187        AssertMsg(   RT_FAILURE(rcReq)
    11881188                  || (   (cbTransfered == pTask->DataSeg.cbSeg)
    1189                       || (pTask->fBounceBuffer && (cbTransfered >= pTask->DataSeg.cbSeg))),
     1189                      || (pTask->cbBounceBuffer && cbTransfered >= pTask->DataSeg.cbSeg)),
    11901190                  ("Task didn't completed successfully (rc=%Rrc) or was incomplete (cbTransfered=%u)\n", rcReq, cbTransfered));
    11911191
     
    11931193        {
    11941194            Assert(pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE);
    1195             Assert(pTask->fBounceBuffer);
    1196 
    1197             memcpy(((uint8_t *)pTask->pvBounceBuffer) + pTask->uBounceBufOffset,
     1195            Assert(pTask->cbBounceBuffer);
     1196
     1197            memcpy(((uint8_t *)pTask->pvBounceBuffer) + pTask->offBounceBuffer,
    11981198                    pTask->DataSeg.pvSeg,
    11991199                    pTask->DataSeg.cbSeg);
     
    12191219        else
    12201220        {
    1221             if (RT_SUCCESS(rc) && pTask->fBounceBuffer)
     1221            if (RT_SUCCESS(rc) && pTask->cbBounceBuffer)
    12221222            {
    12231223                if (pTask->enmTransferType == PDMACTASKFILETRANSFER_READ)
    12241224                    memcpy(pTask->DataSeg.pvSeg,
    1225                             ((uint8_t *)pTask->pvBounceBuffer) + pTask->uBounceBufOffset,
    1226                             pTask->DataSeg.cbSeg);
    1227 
    1228                 RTMemPageFree(pTask->pvBounceBuffer);
     1225                           ((uint8_t *)pTask->pvBounceBuffer) + pTask->offBounceBuffer,
     1226                           pTask->DataSeg.cbSeg);
     1227
     1228                RTMemPageFree(pTask->pvBounceBuffer, pTask->cbBounceBuffer);
    12291229            }
    12301230
  • trunk/src/VBox/VMM/PDMLdr.cpp

    r28262 r28317  
    652652    RTCritSectLeave(&pUVM->pdm.s.ListCritSect);
    653653    RTMemFree(pModule);
    654     RTMemTmpFree(pszFile);
    655654    LogRel(("pdmR3LoadR0U: pszName=\"%s\" rc=%Rrc\n", pszName, rc));
    656655
    657656    /* Don't consider VERR_PDM_MODULE_NAME_CLASH and VERR_NO_MEMORY above as these are very unlikely. */
    658657    if (RT_FAILURE(rc) && pUVM->pVM) /** @todo VMR3SetErrorU. */
    659         return VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s"), pszFilename);
     658        rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s"), pszFilename);
     659
     660    RTMemTmpFree(pszFile); /* might be reference thru pszFilename in the above VMSetError call. */
    660661    return rc;
    661662}
  • trunk/src/VBox/VMM/SSM.cpp

    r26526 r28317  
    16751675        pHead = pCur->pNext;
    16761676        pCur->pNext = NULL;
    1677         RTMemPageFree(pCur);
     1677        RTMemPageFree(pCur, sizeof(*pCur));
    16781678    }
    16791679}
     
    16881688static void ssmR3StrmDelete(PSSMSTRM pStrm)
    16891689{
    1690     RTMemPageFree(pStrm->pCur);
     1690    RTMemPageFree(pStrm->pCur, sizeof(*pStrm->pCur));
    16911691    pStrm->pCur = NULL;
    16921692    ssmR3StrmDestroyBufList(pStrm->pHead);
  • trunk/src/VBox/VMM/VM.cpp

    r28258 r28317  
    523523        RTTlsFree(pUVM->vm.s.idxTLS);
    524524    }
    525     RTMemPageFree(pUVM);
     525    RTMemPageFree(pUVM, sizeof(*pUVM));
    526526    return rc;
    527527}
     
    25102510
    25112511    ASMAtomicUoWriteU32(&pUVM->u32Magic, UINT32_MAX);
    2512     RTMemPageFree(pUVM);
     2512    RTMemPageFree(pUVM, sizeof(*pUVM));
    25132513
    25142514    RTLogFlush(NULL);
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r27254 r28317  
    10901090    { REMPARMDESC_FLAGS_INT,        sizeof(size_t),             NULL },
    10911091    { REMPARMDESC_FLAGS_INT,        sizeof(unsigned),           NULL }
     1092};
     1093static const REMPARMDESC g_aArgsRTMemFree[] =
     1094{
     1095    { REMPARMDESC_FLAGS_INT,        sizeof(void *),             NULL },
     1096    { REMPARMDESC_FLAGS_INT,        sizeof(size_t),             NULL }
    10921097};
    10931098static const REMPARMDESC g_aArgsRTStrPrintf[] =
     
    13271332    { "RTMemFree",                              (void *)(uintptr_t)&RTMemFree,                      &g_aArgsPTR[0],                             RT_ELEMENTS(g_aArgsPTR),                               REMFNDESC_FLAGS_RET_VOID,   0,                  NULL },
    13281333    { "RTMemPageAlloc",                         (void *)(uintptr_t)&RTMemPageAlloc,                 &g_aArgsSIZE_T[0],                          RT_ELEMENTS(g_aArgsSIZE_T),                            REMFNDESC_FLAGS_RET_INT,    sizeof(void *),     NULL },
    1329     { "RTMemPageFree",                          (void *)(uintptr_t)&RTMemPageFree,                  &g_aArgsPTR[0],                             RT_ELEMENTS(g_aArgsPTR),                               REMFNDESC_FLAGS_RET_VOID,   0,                  NULL },
     1334    { "RTMemPageFree",                          (void *)(uintptr_t)&RTMemPageFree,                  &g_aArgsRTMemProtect[0],                    RT_ELEMENTS(g_aArgsRTMemProtect),                      REMFNDESC_FLAGS_RET_VOID,   0,                  NULL },
    13301335    { "RTMemProtect",                           (void *)(uintptr_t)&RTMemProtect,                   &g_aArgsRTMemProtect[0],                    RT_ELEMENTS(g_aArgsRTMemProtect),                      REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    13311336    { "RTStrPrintf",                            (void *)(uintptr_t)&RTStrPrintf,                    &g_aArgsRTStrPrintf[0],                     RT_ELEMENTS(g_aArgsRTStrPrintf),                       REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(size_t), NULL },
  • trunk/src/recompiler/VBoxRecompiler.c

    r27254 r28317  
    513513        if (RT_FAILURE(rc))
    514514        {
    515             RTMemPageFree(phys_ram_dirty);
     515            RTMemPageFree(phys_ram_dirty, cbBitmapFull);
    516516            AssertLogRelRCReturn(rc, rc);
    517517        }
  • trunk/src/recompiler/osdep.h

    r17274 r28317  
    2121#endif
    2222#define qemu_vsnprintf(pszBuf, cbBuf, pszFormat, args) \
    23                                RTStrPrintfV((pszBuf), (cbBuf), (pszFormat), (args))
     23                                RTStrPrintfV((pszBuf), (cbBuf), (pszFormat), (args))
    2424#define qemu_vprintf(pszFormat, args) \
    25                                RTLogPrintfV((pszFormat), (args))
    26 #define qemu_printf            RTLogPrintf
    27 #define qemu_malloc(cb)        RTMemAlloc(cb)
    28 #define qemu_mallocz(cb)       RTMemAllocZ(cb)
    29 #define qemu_realloc(ptr, cb)  RTMemRealloc(ptr, cb)
     25                                RTLogPrintfV((pszFormat), (args))
     26#define qemu_printf             RTLogPrintf
     27#define qemu_malloc(cb)         RTMemAlloc(cb)
     28#define qemu_mallocz(cb)        RTMemAllocZ(cb)
     29#define qemu_realloc(ptr, cb)   RTMemRealloc(ptr, cb)
    3030
    31 #define qemu_free(pv)       RTMemFree(pv)
    32 #define qemu_strdup(psz)    RTStrDup(psz)
     31#define qemu_free(pv)           RTMemFree(pv)
     32#define qemu_strdup(psz)        RTStrDup(psz)
    3333
    34 #define qemu_vmalloc(cb)    RTMemPageAlloc(cb)
    35 #define qemu_vfree(pv)      RTMemPageFree(pv)
     34#define qemu_vmalloc(cb)        RTMemPageAlloc(cb)
     35#define qemu_vfree(pv)          RTMemPageFree(pv, ???)
    3636
    3737#ifndef NULL
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