StuBS
cache.h File Reference

Helper for cache alignment. More...

#include "debug/assert.h"
Include dependency graph for cache.h:
This graph shows which files directly or indirectly include this file:

Macros

#define CACHE_LINE_SIZE   64
 
#define cache_aligned   alignas(CACHE_LINE_SIZE)
 
#define assert_cache_aligned(TYPE)    static_assert(sizeof(TYPE) % CACHE_LINE_SIZE == 0, STRINGIFY(TYPE) "Not aligned on cache boundary")
 Compile time check of cache alignment.
 

Detailed Description

Helper for cache alignment.

Macro Definition Documentation

◆ CACHE_LINE_SIZE

#define CACHE_LINE_SIZE   64

◆ cache_aligned

#define cache_aligned   alignas(CACHE_LINE_SIZE)

◆ assert_cache_aligned

#define assert_cache_aligned (   TYPE)     static_assert(sizeof(TYPE) % CACHE_LINE_SIZE == 0, STRINGIFY(TYPE) "Not aligned on cache boundary")

Compile time check of cache alignment.

Parameters
TYPEdata type to check