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 LIKELY(x)
 
#define MAYBE_NULL(T)
 
#define NEVER_NULL(T)
 
#define OUT(ptr)
 
#define IN(ptr)
 
#define INOUT(ptr)
 
#define EXPAND(...)
 
#define FORCE_INLINE   inline __attribute__((always_inline))
 

Functions

static size_t next_power_of_2 (size_t x)
 

Macro Definition Documentation

◆ EXPAND

#define EXPAND ( ...)
Value:
__VA_ARGS__

Definition at line 16 of file core.h.

◆ FORCE_INLINE

#define FORCE_INLINE   inline __attribute__((always_inline))

Definition at line 39 of file core.h.

◆ IN

#define IN ( ptr)
Value:
ptr

Definition at line 13 of file core.h.

◆ INOUT

#define INOUT ( ptr)
Value:
ptr

Definition at line 14 of file core.h.

◆ LIKELY

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

Definition at line 7 of file core.h.

◆ MAYBE_NULL

#define MAYBE_NULL ( T)
Value:
T*
#define T
Definition template.h:16

Definition at line 9 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.

◆ NEVER_NULL

#define NEVER_NULL ( T)
Value:
T*

Definition at line 10 of file core.h.

◆ OUT

#define OUT ( ptr)
Value:
ptr

Definition at line 12 of file core.h.

Function Documentation

◆ next_power_of_2()

static size_t next_power_of_2 ( size_t x)
inlinestatic

Definition at line 24 of file core.h.

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