detecting the memory page size

前端 未结 7 1977
野性不改
野性不改 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 13:54

    C doesn't know anything about memory pages. On posix systems you can use long pagesize = sysconf(_SC_PAGE_SIZE);

提交回复
热议问题