VirtualBox

Ignore:
Timestamp:
Mar 20, 2025 3:29:22 PM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168070
Message:

HostDrivers/Support/testcase/tstContiguous.cpp: Make it work for hosts where we don't know the host page size when building, bugref:10391

File:
1 edited

Legend:

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

    r106061 r108657  
    4343#include <iprt/initterm.h>
    4444#include <iprt/stream.h>
     45#include <iprt/system.h>
    4546#include <stdlib.h>
    4647#include <string.h>
     
    5859    if (!rc)
    5960    {
     61        uint32_t const cbPage = RTSystemGetPageSize();
     62
    6063        /*
    6164         * Allocate a bit of contiguous memory.
     
    6669        if (pv && HCPhys)
    6770        {
    68             memset(pv, 0xff, PAGE_SIZE * 8);
     71            memset(pv, 0xff, cbPage * 8);
    6972            pv = SUPR3ContAlloc(5, NULL, &HCPhys);
    7073            rcRet += pv == NULL || HCPhys == 0;
    7174            if (pv && HCPhys)
    7275            {
    73                 memset(pv, 0x7f, PAGE_SIZE * 5);
     76                memset(pv, 0x7f, cbPage * 5);
    7477                rc = SUPR3ContFree(pv, 5);
    7578                rcRet += rc != 0;
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