detecting the memory page size

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

    It is entirely platform dependent which address-ranges are mapped to which page-sizes. Further the pagesize is not system-wide. You can allocate memory from different page-size regions according to the use case. And you can even have platforms without any virtual memory managment.

    So, code handling this topic must be platform specific.

提交回复
热议问题