Izza Izza - 10 months ago 127
C++ Question

Finding the cache block size

How do I find the cache block size in Ubuntu, programmatically (with C++) or otherwise?

Answer

You can find it in /proc/cpuinfo; cache size for the total size, and cache_alignment for the block size.