Rizin
unix-like reverse engineering framework and cli tools
atomic.h File Reference
#include <stdint.h>

Go to the source code of this file.

Functions

static size_t atomic_load (const volatile size_t *p)
 
static uint32_t atomic_inc (volatile uint32_t *p)
 
static uint32_t atomic_dec (volatile uint32_t *p)
 

Function Documentation

◆ atomic_dec()

static uint32_t atomic_dec ( volatile uint32_t p)
inlinestatic

Definition at line 52 of file atomic.h.

52  {
53  return __sync_sub_and_fetch(p, 1u);
54 }
void * p
Definition: libc.cpp:67

References p.

Referenced by ts_subtree_release().

◆ atomic_inc()

static uint32_t atomic_inc ( volatile uint32_t p)
inlinestatic

Definition at line 48 of file atomic.h.

48  {
49  return __sync_add_and_fetch(p, 1u);
50 }

References p.

Referenced by ts_subtree_retain().

◆ atomic_load()

static size_t atomic_load ( const volatile size_t p)
inlinestatic

Definition at line 40 of file atomic.h.

40  {
41 #ifdef __ATOMIC_RELAXED
42  return __atomic_load_n(p, __ATOMIC_RELAXED);
43 #else
44  return __sync_fetch_and_add((volatile size_t *)p, 0);
45 #endif
46 }

References p.

Referenced by ts_parser__advance().