Apollo  6.0
Open source self driving car software
Macros | Functions
macros.h File Reference
#include <cstdlib>
#include <new>
Include dependency graph for macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define cyber_likely(x)   (x)
 
#define cyber_unlikely(x)   (x)
 
#define CACHELINE_SIZE   64
 
#define DEFINE_TYPE_TRAIT(name, func)
 

Functions

void cpu_relax ()
 
void * CheckedMalloc (size_t size)
 
void * CheckedCalloc (size_t num, size_t size)
 

Macro Definition Documentation

◆ CACHELINE_SIZE

#define CACHELINE_SIZE   64

◆ cyber_likely

#define cyber_likely (   x)    (x)

◆ cyber_unlikely

#define cyber_unlikely (   x)    (x)

◆ DEFINE_TYPE_TRAIT

#define DEFINE_TYPE_TRAIT (   name,
  func 
)
Value:
template <typename T> \
struct name { \
template <typename Class> \
static constexpr bool Test(decltype(&Class::func)*) { \
return true; \
} \
template <typename> \
static constexpr bool Test(...) { \
return false; \
} \
\
static constexpr bool value = Test<T>(nullptr); \
}; \
\
template <typename T> \
constexpr bool name<T>::value;
void(* func)(void *)
Definition: routine_context.h:41
apollo::cyber::base::std value

Function Documentation

◆ CheckedCalloc()

void* CheckedCalloc ( size_t  num,
size_t  size 
)
inline

◆ CheckedMalloc()

void* CheckedMalloc ( size_t  size)
inline

◆ cpu_relax()

void cpu_relax ( )
inline