VirtualBox

Changeset 99460 in vbox


Ignore:
Timestamp:
Apr 19, 2023 2:55:55 PM (20 months ago)
Author:
vboxsync
Message:

HostDrivers/testcase: tstPin: Pages, not bytes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp

    r99457 r99460  
    153153    RTTestISub("Contiguous memory");
    154154
    155     size_t cbAlloc = RT_ALIGN_Z(15003, PAGE_SIZE) >> PAGE_SHIFT;
    156 
    157     pv = SUPR3ContAlloc(cbAlloc, NULL, &HCPhys);
     155    size_t cPages = RT_ALIGN_Z(15003, PAGE_SIZE) >> PAGE_SHIFT;
     156
     157    pv = SUPR3ContAlloc(cPages, NULL, &HCPhys);
    158158    if (pv && HCPhys)
    159159    {
     
    176176    }
    177177    else
    178         RTTestIFailed("SUPR3ContAlloc(%zu bytes) failed!\n", cbAlloc);
     178        RTTestIFailed("SUPR3ContAlloc(%zu pages) failed!\n", cPages);
    179179
    180180    RTTestISubDone();
     
    187187    #define BIG_SIZE    72*1024*1024
    188188    #define BIG_SIZEPP  (BIG_SIZE + PAGE_SIZE)
    189     pv      = NULL;
    190     cbAlloc = BIG_SIZEPP >> PAGE_SHIFT;
    191     rc = SUPR3PageAlloc(cbAlloc, 0, &pv);
     189    pv     = NULL;
     190    cPages = BIG_SIZEPP >> PAGE_SHIFT;
     191    rc = SUPR3PageAlloc(cPages, 0, &pv);
    192192    if (RT_SUCCESS(rc))
    193193    {
     
    215215        else
    216216            RTTestIFailed("SUPPageLock(%p) failed with rc=%Rrc\n", pvAligned, rc);
    217         SUPR3PageFree(pv, cbAlloc);
     217        SUPR3PageFree(pv, cPages);
    218218    }
    219219    else
    220         RTTestIFailed("SUPPageAlloc(%zu bytes) failed with rc=%Rrc\n", cbAlloc, rc);
     220        RTTestIFailed("SUPPageAlloc(%zu pages) failed with rc=%Rrc\n", cPages, rc);
    221221
    222222    RTTestISubDone();
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