Hi there,
I'm found the following calculation in cacheline.h:
inline static size_t cacheLineAlignedSize(size_t sz) noexcept { return (CACHE_LINE_SIZE * ((sz + CACHE_LINE_SIZE - 1) / CACHE_LINE_SIZE)) + CACHE_LINE_SIZE - 1; }
I'm a bit confused, could you please explain what is the need of this calculation? If my cacheline is 64 bytes and I have a structure of 64 bytes why do I need to reserve 127 bytes?
Thanks.
Hi there,
I'm found the following calculation in cacheline.h:
inline static size_t cacheLineAlignedSize(size_t sz) noexcept { return (CACHE_LINE_SIZE * ((sz + CACHE_LINE_SIZE - 1) / CACHE_LINE_SIZE)) + CACHE_LINE_SIZE - 1; }I'm a bit confused, could you please explain what is the need of this calculation? If my cacheline is 64 bytes and I have a structure of 64 bytes why do I need to reserve 127 bytes?
Thanks.