Align statistics to cache lines

Aligning the statistics object indices to cache line size reduces the CPU
overhead of gathering the statistics. This allows the statistics to more
accurately measure the polling system without the measurement affecting
the outcome.
This commit is contained in:
Markus Makela
2016-12-09 17:39:31 +02:00
parent 5cb738ae03
commit 49aa23468d
6 changed files with 127 additions and 43 deletions

View File

@ -37,6 +37,12 @@ MXS_BEGIN_DECLS
#define MXS_ARRAY_NELEMS(array) ((size_t)(sizeof(array)/sizeof(array[0])))
/** Macro for safe pointer arithmetic on void pointers
* @param a The void pointer
* @param b The offset into @c a
*/
#define MXS_PTR(a, b) (((uint8_t*)(a)) + (b))
bool utils_init(); /*< Call this first before using any other function */
void utils_end();