How to programmatically get the CPU cache page size in C++?

后端 未结 7 1574
渐次进展
渐次进展 2020-12-13 04:49

I\'d like my program to read the cache line size of the CPU it\'s running on in C++.

I know that this can\'t be done portably, so I will need a solution for Linux an

7条回答
  •  旧巷少年郎
    2020-12-13 05:52

    On Linux try the proccpuinfo library, an architecture independent C API for reading /proc/cpuinfo

提交回复
热议问题