1 #ifndef TREE_SITTER_ATOMIC_H_
2 #define TREE_SITTER_ATOMIC_H_
8 static inline size_t atomic_load(
const volatile size_t *
p) {
26 static inline size_t atomic_load(
const volatile size_t *
p) {
41 #ifdef __ATOMIC_RELAXED
42 return __atomic_load_n(
p, __ATOMIC_RELAXED);
44 return __sync_fetch_and_add((
volatile size_t *)
p, 0);
49 return __sync_add_and_fetch(
p, 1u);
53 return __sync_sub_and_fetch(
p, 1u);
static uint32_t atomic_dec(volatile uint32_t *p)
static size_t atomic_load(const volatile size_t *p)
static uint32_t atomic_inc(volatile uint32_t *p)