Project Alice
|
Go to the source code of this file.
Macros | |
#define | INLINE_KEYWORD |
#define | FORCE_INLINE_ATTR |
#define | WIN_CDECL |
#define | UNUSED_ATTR |
#define | FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR UNUSED_ATTR |
#define | HINT_INLINE FORCE_INLINE_TEMPLATE |
#define | MEM_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */ |
#define | FORCE_NOINLINE static |
#define | TARGET_ATTRIBUTE(target) |
#define | BMI2_TARGET_ATTRIBUTE TARGET_ATTRIBUTE("lzcnt,bmi,bmi2") |
#define | PREFETCH_L1(ptr) do { (void)(ptr); } while (0) /* disabled */ |
#define | PREFETCH_L2(ptr) do { (void)(ptr); } while (0) /* disabled */ |
#define | CACHELINE_SIZE 64 |
#define | PREFETCH_AREA(p, s) |
#define | DONT_VECTORIZE |
#define | LIKELY(x) (x) |
#define | UNLIKELY(x) (x) |
#define | ZSTD_UNREACHABLE do { assert(0); } while (0) |
#define | STATIC_BMI2 0 |
#define | ZSTD_HAS_C_ATTRIBUTE(x) 0 |
#define | ZSTD_HAS_CPP_ATTRIBUTE(x) 0 |
#define | ZSTD_FALLTHROUGH |
#define | ZSTD_ALIGNOF(T) (sizeof(void*) < sizeof(T) ? sizeof(void*) : sizeof(T)) |
#define | ZSTD_ALLOW_POINTER_OVERFLOW_ATTR |
Functions | |
MEM_STATIC ZSTD_ALLOW_POINTER_OVERFLOW_ATTR ptrdiff_t | ZSTD_wrappedPtrDiff (unsigned char const *lhs, unsigned char const *rhs) |
MEM_STATIC ZSTD_ALLOW_POINTER_OVERFLOW_ATTR unsigned char const * | ZSTD_wrappedPtrAdd (unsigned char const *ptr, ptrdiff_t add) |
MEM_STATIC ZSTD_ALLOW_POINTER_OVERFLOW_ATTR unsigned char const * | ZSTD_wrappedPtrSub (unsigned char const *ptr, ptrdiff_t sub) |
MEM_STATIC unsigned char * | ZSTD_maybeNullPtrAdd (unsigned char *ptr, ptrdiff_t add) |
#define BMI2_TARGET_ATTRIBUTE TARGET_ATTRIBUTE("lzcnt,bmi,bmi2") |
Definition at line 130 of file compiler.h.
#define CACHELINE_SIZE 64 |
Definition at line 154 of file compiler.h.
#define DONT_VECTORIZE |
Definition at line 176 of file compiler.h.
#define FORCE_INLINE_ATTR |
Definition at line 35 of file compiler.h.
#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR UNUSED_ATTR |
FORCE_INLINE_TEMPLATE is used to define C "templates", which take constant parameters. They must be inlined for the compiler to eliminate the constant branches.
Definition at line 68 of file compiler.h.
#define FORCE_NOINLINE static |
Definition at line 114 of file compiler.h.
#define HINT_INLINE FORCE_INLINE_TEMPLATE |
HINT_INLINE is used to help the compiler generate better code. It is not used for "templates", so it can be tweaked based on the compilers performance.
gcc-4.8 and gcc-4.9 have been shown to benefit from leaving off the always_inline attribute.
clang up to 5.0.0 (trunk) benefit tremendously from the always_inline attribute.
Definition at line 83 of file compiler.h.
#define INLINE_KEYWORD |
Definition at line 27 of file compiler.h.
#define LIKELY | ( | x | ) | (x) |
Definition at line 188 of file compiler.h.
#define MEM_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */ |
Definition at line 103 of file compiler.h.
#define PREFETCH_AREA | ( | p, | |
s | |||
) |
Definition at line 156 of file compiler.h.
#define PREFETCH_L1 | ( | ptr | ) | do { (void)(ptr); } while (0) /* disabled */ |
Definition at line 149 of file compiler.h.
#define PREFETCH_L2 | ( | ptr | ) | do { (void)(ptr); } while (0) /* disabled */ |
Definition at line 150 of file compiler.h.
#define STATIC_BMI2 0 |
Definition at line 220 of file compiler.h.
#define TARGET_ATTRIBUTE | ( | target | ) |
Definition at line 123 of file compiler.h.
#define UNLIKELY | ( | x | ) | (x) |
Definition at line 189 of file compiler.h.
#define UNUSED_ATTR |
Definition at line 60 of file compiler.h.
#define WIN_CDECL |
On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC). This explicitly marks such functions as __cdecl so that the code will still compile if a CC other than __cdecl has been made the default.
Definition at line 53 of file compiler.h.
#define ZSTD_ALIGNOF | ( | T | ) | (sizeof(void*) < sizeof(T) ? sizeof(void*) : sizeof(T)) |
Definition at line 299 of file compiler.h.
#define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR |
Zstd relies on pointer overflow in its decompressor. We add this attribute to functions that rely on pointer overflow.
Definition at line 322 of file compiler.h.
#define ZSTD_FALLTHROUGH |
Definition at line 271 of file compiler.h.
#define ZSTD_HAS_C_ATTRIBUTE | ( | x | ) | 0 |
Definition at line 243 of file compiler.h.
#define ZSTD_HAS_CPP_ATTRIBUTE | ( | x | ) | 0 |
Definition at line 252 of file compiler.h.
#define ZSTD_UNREACHABLE do { assert(0); } while (0) |
Definition at line 195 of file compiler.h.
MEM_STATIC unsigned char * ZSTD_maybeNullPtrAdd | ( | unsigned char * | ptr, |
ptrdiff_t | add | ||
) |
Helper function to add to a pointer that works around C's undefined behavior of adding 0 to NULL.
ptr + add
except it defines NULL + 0 == NULL
. Definition at line 371 of file compiler.h.
MEM_STATIC ZSTD_ALLOW_POINTER_OVERFLOW_ATTR unsigned char const * ZSTD_wrappedPtrAdd | ( | unsigned char const * | ptr, |
ptrdiff_t | add | ||
) |
Helper function to perform a wrapped pointer add without triggering UBSAN.
Definition at line 346 of file compiler.h.
MEM_STATIC ZSTD_ALLOW_POINTER_OVERFLOW_ATTR ptrdiff_t ZSTD_wrappedPtrDiff | ( | unsigned char const * | lhs, |
unsigned char const * | rhs | ||
) |
Helper function to perform a wrapped pointer difference without trigging UBSAN.
Definition at line 334 of file compiler.h.
MEM_STATIC ZSTD_ALLOW_POINTER_OVERFLOW_ATTR unsigned char const * ZSTD_wrappedPtrSub | ( | unsigned char const * | ptr, |
ptrdiff_t | sub | ||
) |
Helper function to perform a wrapped pointer subtraction without triggering UBSAN.
Definition at line 359 of file compiler.h.