c - How to store array to fit cache line size -
i want have array 32 elements of 64bit numbers : long int arr[32];
however cache line size 64 bytes. mean array not go @ cache system or rather of elements do?
would fit cache if split array two-dimensional : long int arr[4][8]; ?
- your array 256 bytes, not fit in 1 64 byte cache line.
- splitting array won't decrease size, #1 still applies.
- your cpu has multiple cache lines, it's 256 bytes fit in whatever cache worried about.