detecting the memory page size

前端 未结 7 1979
野性不改
野性不改 2021-02-08 13:31

Is there a portable way to detect (programmatically) the memory page size using C or C++ code ?

相关标签:
7条回答
  • 2021-02-08 14:15

    Windows 10, Visual Studio 2017, C++. Get the page size in bytes.

    int main()
    {
        SYSTEM_INFO sysInfo;
    
        GetSystemInfo(&sysInfo);
    
        printf("%s %d\n\n", "PageSize[Bytes] :", sysInfo.dwPageSize);
    
        getchar();
    
        return 0;
    }
    
    0 讨论(0)
提交回复
热议问题