VirtualBox

Changeset 15508 in vbox for trunk


Ignore:
Timestamp:
Dec 15, 2008 3:05:16 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40989
Message:

#3349: Changed a few MMHyperAlloc calls to MMR3HyperAllocOnceNoRel to save heap space.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r15252 r15508  
    201201    /** Pointer to the I/O buffer. */
    202202    RCPTRTYPE(uint8_t *) pbIOBufferRC;
    203    
     203
    204204    RTRCPTR Aligmnent1; /**< Align the statistics at an 8-byte boundrary. */
    205205
     
    55885588            pIf->cbIOBuffer = ATA_MAX_MULT_SECTORS * 512;
    55895589        Assert(!pIf->pbIOBufferR3);
    5590         rc = MMHyperAlloc(pVM, pIf->cbIOBuffer, 1, MM_TAG_PDM_DEVICE_USER, (void **)&pIf->pbIOBufferR3); /** @todo rainy day: change to MMR3HyperAllocOnceNoRel */
     5590        rc = MMR3HyperAllocOnceNoRel(pVM, pIf->cbIOBuffer, 0, MM_TAG_PDM_DEVICE_USER, (void **)&pIf->pbIOBufferR3);
    55915591        if (RT_FAILURE(rc))
    55925592            return VERR_NO_MEMORY;
  • trunk/src/VBox/VMM/MMHyper.cpp

    r15506 r15508  
    840840    /*
    841841     * Choose between allocating a new chunk of HMA memory
    842      * and the heap. We will only do BIG allocations from HMA.
    843      */
    844     if (    cb < _64K
    845         &&  (   uAlignment != PAGE_SIZE
    846              || cb < 48*_1K))
     842     * and the heap. We will only do BIG allocations from HMA and
     843     * only at creation time.
     844     */
     845    if (   (   cb < _64K
     846            && (   uAlignment != PAGE_SIZE
     847               || cb < 48*_1K))
     848        ||  VMR3GetState(pVM) != VMSTATE_CREATING)
    847849    {
    848850        int rc = MMHyperAlloc(pVM, cb, uAlignment, enmTag, ppv);
  • trunk/src/VBox/VMM/VMM.cpp

    r14683 r15508  
    224224    /** @todo SMP: On stack per vCPU. */
    225225#ifdef VBOX_STRICT_VMM_STACK
    226     int rc = MMHyperAlloc(pVM, VMM_STACK_SIZE + PAGE_SIZE + PAGE_SIZE, PAGE_SIZE, MM_TAG_VMM, (void **)&pVM->vmm.s.pbEMTStackR3);
     226    int rc = MMR3HyperAllocOnceNoRel(pVM, VMM_STACK_SIZE + PAGE_SIZE + PAGE_SIZE, PAGE_SIZE, MM_TAG_VMM, (void **)&pVM->vmm.s.pbEMTStackR3);
    227227#else
    228     int rc = MMHyperAlloc(pVM, VMM_STACK_SIZE, PAGE_SIZE, MM_TAG_VMM, (void **)&pVM->vmm.s.pbEMTStackR3);
     228    int rc = MMR3HyperAllocOnceNoRel(pVM, VMM_STACK_SIZE, PAGE_SIZE, MM_TAG_VMM, (void **)&pVM->vmm.s.pbEMTStackR3);
    229229#endif
    230230    if (RT_SUCCESS(rc))
     
    266266    {
    267267        pVM->vmm.s.cbRCLogger = RT_OFFSETOF(RTLOGGERRC, afGroups[pLogger->cGroups]);
    268         rc = MMHyperAlloc(pVM, pVM->vmm.s.cbRCLogger, 0, MM_TAG_VMM, (void **)&pVM->vmm.s.pRCLoggerR3);
     268        rc = MMR3HyperAllocOnceNoRel(pVM, pVM->vmm.s.cbRCLogger, 0, MM_TAG_VMM, (void **)&pVM->vmm.s.pRCLoggerR3);
    269269        if (RT_FAILURE(rc))
    270270            return rc;
     
    272272
    273273# ifdef VBOX_WITH_R0_LOGGING
    274         rc = MMHyperAlloc(pVM, RT_OFFSETOF(VMMR0LOGGER, Logger.afGroups[pLogger->cGroups]),
    275                           0, MM_TAG_VMM, (void **)&pVM->vmm.s.pR0LoggerR3);
     274        rc = MMR3HyperAllocOnceNoRel(pVM, RT_OFFSETOF(VMMR0LOGGER, Logger.afGroups[pLogger->cGroups]),
     275                                     0, MM_TAG_VMM, (void **)&pVM->vmm.s.pR0LoggerR3);
    276276        if (RT_FAILURE(rc))
    277277            return rc;
     
    292292    {
    293293        pVM->vmm.s.cbRCRelLogger = RT_OFFSETOF(RTLOGGERRC, afGroups[pRelLogger->cGroups]);
    294         rc = MMHyperAlloc(pVM, pVM->vmm.s.cbRCRelLogger, 0, MM_TAG_VMM, (void **)&pVM->vmm.s.pRCRelLoggerR3);
     294        rc = MMR3HyperAllocOnceNoRel(pVM, pVM->vmm.s.cbRCRelLogger, 0, MM_TAG_VMM, (void **)&pVM->vmm.s.pRCRelLoggerR3);
    295295        if (RT_FAILURE(rc))
    296296            return rc;
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