density
C++11 library for paged memory management, function queues, heterogeneous queues and lifo memory management
Classes | Namespaces | Macros | Typedefs | Variables
density_config.h File Reference
#include <cstdlib>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

class  basic_default_allocator< PAGE_CAPACITY_AND_ALIGNMENT >
 

Namespaces

 density
 

Macros

#define DENSITY_ASSERT(...)   ((void)(0))
 
#define DENSITY_ASSERT_INTERNAL(...)   ((void)(0))
 
#define DENSITY_ASSUME(bool_expr, ...)   (void)0
 
#define DENSITY_ASSUME_ALIGNED(address, constexpr_alignment)    DENSITY_ASSUME((uintptr_t(address) & ((constexpr_alignment)-1)) == 0)
 
#define DENSITY_ASSUME_UINT_ALIGNED(address, constexpr_alignment)    DENSITY_ASSUME(((address) & ((constexpr_alignment)-1)) == 0)
 
#define DENSITY_LIKELY(bool_expr)   (bool_expr)
 
#define DENSITY_NO_INLINE
 
#define DENSITY_CHECKING_ASSERT(bool_expr, ...)   (!(bool_expr) ? std::abort() : (void)0)
 

Typedefs

using data_stack_underlying_allocator = basic_default_allocator< default_page_capacity >
 
template<typename TYPE >
using optional = builtin_optional< TYPE >
 

Variables

constexpr size_t destructive_interference_size = 64
 
constexpr size_t default_page_capacity = 1024 * 64
 
constexpr bool enable_relaxed_atomics = false
 

Macro Definition Documentation

#define DENSITY_ASSERT (   ...)    ((void)(0))

Assert used to detect user errors that causes undefined behavior

#define DENSITY_ASSERT_INTERNAL (   ...)    ((void)(0))

Assert used to detect bugs of the library that causes undefined behavior

#define DENSITY_ASSUME (   bool_expr,
  ... 
)    (void)0

Macro that tells an invariant to the compiler as hint for the optimizer.

#define DENSITY_ASSUME_ALIGNED (   address,
  constexpr_alignment 
)    DENSITY_ASSUME((uintptr_t(address) & ((constexpr_alignment)-1)) == 0)

Macro used to enforce the alignment of a pointer as an invariant.

#define DENSITY_LIKELY (   bool_expr)    (bool_expr)

Macro that tells to the compiler that a condition is true in most cases. This is just an hint to the optimizer.

#define DENSITY_NO_INLINE

Macro used in some circumstances to avoid inlining of a function, for example because the call handles a somewhat rare slow path.

#define DENSITY_CHECKING_ASSERT (   bool_expr,
  ... 
)    (!(bool_expr) ? std::abort() : (void)0)

Assert that on failure should cause an halt of the program. Used only locally in this header.