VirtualBox

Changeset 4766 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 13, 2007 11:05:58 AM (17 years ago)
Author:
vboxsync
Message:

Too early to user MMHyperAlloc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/MMPagePool.cpp

    r4763 r4766  
    6161     * Allocate the pool structures.
    6262     */
    63     int rc = MMHyperAlloc(pVM, sizeof(*pVM->mm.s.pPagePool), 0, MM_TAG_MM_PAGE, (void **)&pVM->mm.s.pPagePool);
     63    AssertRelease(sizeof(*pVM->mm.s.pPagePool) + sizeof(*pVM->mm.s.pPagePoolLow) < PAGE_SIZE);
     64    int rc = SUPPageAllocLocked(1, (void **)&pVM->mm.s.pPagePool);
    6465    if (VBOX_FAILURE(rc))
    6566        return rc;
     67    memset(pVM->mm.s.pPagePool, 0, PAGE_SIZE);
    6668    pVM->mm.s.pPagePool->pVM = pVM;
    6769    STAM_REG(pVM, &pVM->mm.s.pPagePool->cPages,         STAMTYPE_U32,     "/MM/Page/Def/cPages",        STAMUNIT_PAGES, "Number of pages in the default pool.");
     
    7476    STAM_REG(pVM, &pVM->mm.s.pPagePool->cErrors,        STAMTYPE_COUNTER, "/MM/Page/Def/cErrors",       STAMUNIT_ERRORS,"Number of errors for the default pool.");
    7577
    76     rc = MMHyperAlloc(pVM, sizeof(*pVM->mm.s.pPagePoolLow), 0, MM_TAG_MM_PAGE, (void **)&pVM->mm.s.pPagePoolLow);
    77     if (VBOX_FAILURE(rc))
    78         return rc;
     78    pVM->mm.s.pPagePoolLow = pVM->mm.s.pPagePool + 1;
    7979    pVM->mm.s.pPagePoolLow->pVM = pVM;
    8080    pVM->mm.s.pPagePoolLow->fLow = true;
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