VirtualBox

Changeset 72612 in vbox


Ignore:
Timestamp:
Jun 19, 2018 12:42:51 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123110
Message:

tstMMHyperHeap: Don't use SUPR3LowAlloc for the testing since it has a rather low page limit when used from ring-3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp

    r69111 r72612  
    5959    int rc = SUPR3Init(NULL);
    6060    if (RT_SUCCESS(rc))
    61         rc = SUPR3LowAlloc(RT_ELEMENTS(aPages), (void **)&pVM, &pvR0, &aPages[0]);
     61        //rc = SUPR3LowAlloc(RT_ELEMENTS(aPages), (void **)&pVM, &pvR0, &aPages[0]);
     62        rc = SUPR3PageAllocEx(RT_ELEMENTS(aPages), 0, (void **)&pVM, &pvR0, &aPages[0]);
    6263    if (RT_FAILURE(rc))
    6364    {
    6465        RTPrintf("Fatal error: SUP Failure! rc=%Rrc\n", rc);
    65         return 1;
     66        return RTEXITCODE_FAILURE;
    6667    }
    6768    memset(pVM, 0, sizeof(*pVM)); /* wtf? */
     
    6970    pVM->pVMR0 = pvR0;
    7071
    71     static UVM s_UVM;
    72     PUVM pUVM = &s_UVM;
     72    PUVM pUVM = (PUVM)RTMemPageAllocZ(RT_ALIGN_Z(sizeof(*pUVM), PAGE_SIZE));
     73    if (!pUVM)
     74    {
     75        RTPrintf("Fatal error: RTMEmPageAllocZ failed\n");
     76        return RTEXITCODE_FAILURE;
     77    }
     78    pUVM->u32Magic = UVM_MAGIC;
    7379    pUVM->pVM = pVM;
    7480    pVM->pUVM = pUVM;
     
    244250    RTLogFlush(NULL);
    245251#endif
     252    SUPR3PageFreeEx(pVM, RT_ELEMENTS(aPages));
     253    RTMemPageFree(pUVM, RT_ALIGN_Z(sizeof(*pUVM), PAGE_SIZE));
    246254    return 0;
    247255}
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