Derive-C
Loading...
Searching...
No Matches
core.h File Reference
#include <stdlib.h>
Include dependency graph for core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gdb_marker

Macros

#define NAME_EXPANDED(pre, post)
#define NAME(pre, post)
#define DEBUG_UNUSED(ident)
#define UNUSED(ident)
#define LIKELY(x)
#define EXPAND(...)
#define FORCE_INLINE   inline __attribute__((always_inline))

Functions

static size_t next_power_of_2 (size_t x)

Macro Definition Documentation

◆ DEBUG_UNUSED

#define DEBUG_UNUSED ( ident)
Value:
ident __attribute__((unused))

Definition at line 8 of file core.h.

◆ EXPAND

#define EXPAND ( ...)
Value:
__VA_ARGS__

Definition at line 17 of file core.h.

◆ FORCE_INLINE

#define FORCE_INLINE   inline __attribute__((always_inline))

Definition at line 43 of file core.h.

◆ LIKELY

#define LIKELY ( x)
Value:
__builtin_expect(!!(x), 1)

Definition at line 15 of file core.h.

◆ NAME

#define NAME ( pre,
post )
Value:
NAME_EXPANDED(pre, post)
#define NAME_EXPANDED(pre, post)
Definition core.h:4

Definition at line 5 of file core.h.

◆ NAME_EXPANDED

#define NAME_EXPANDED ( pre,
post )
Value:
pre##_##post

Definition at line 4 of file core.h.

◆ UNUSED

#define UNUSED ( ident)
Value:
ident __attribute__((unused))

Definition at line 13 of file core.h.

Function Documentation

◆ next_power_of_2()

size_t next_power_of_2 ( size_t x)
inlinestatic

Definition at line 28 of file core.h.

28 {
29 if (x == 0)
30 return 1;
31 x--;
32 x |= x >> 1;
33 x |= x >> 2;
34 x |= x >> 4;
35 x |= x >> 8;
36 x |= x >> 16;
37#if SIZE_MAX > 0xFFFFFFFF
38 x |= x >> 32; // For 64-bit platforms
39#endif
40 return x + 1;
41}
Here is the caller graph for this function: