Zero  0.1.0
Classes | Functions | Variables
w_defines.h File Reference
#include "shore-config.h"
#include "shore.def"
#include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <climits>
#include <cstdint>
#include <unistd.h>
#include <sys/types.h>

Go to the source code of this file.

Classes

class  allocaN< N >
 constructs a blob of N bytes. More...
 

Functions

template<class T >
static Taligned_cast (char const *ptr)
 

Variables

const size_t CACHELINE_SIZE = 64
 CPU Cache line size in bytes. More...
 

Function Documentation

§ aligned_cast()

template<class T >
static T* aligned_cast ( char const *  ptr)
inlinestatic

Variable Documentation

§ CACHELINE_SIZE

const size_t CACHELINE_SIZE = 64

CPU Cache line size in bytes.

Most modern CPU has 64 bytes cacheline. Some less popular CPU like Spark uses 128 bytes. This value is used for padding to keep lock objects in different cachelines. TODO: CMake script to automatically detect this and cmakedefine for it (JIRA ZERO-179).