detecting the memory page size

前端 未结 7 1991
野性不改
野性不改 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:06

    Across operating systems, no.

    On Linux systems:

    #include 
    long sz = sysconf (_SC_PAGESIZE);
    

提交回复
热议问题