11#ifndef CORE_GP_REF_COUNT_H
12#define CORE_GP_REF_COUNT_H
17typedef unsigned int gp_refcnt;
19static inline bool gp_refcnt_inc(gp_refcnt *self)
21 gp_refcnt new_val, old_val;
29 if (old_val == UINT_MAX)
32 new_val = old_val + 1;
34 }
while (!__sync_bool_compare_and_swap(self, old_val, new_val));
39static inline bool gp_refcnt_dec(gp_refcnt *self)
41 gp_refcnt new_val, old_val;
46 if (old_val == UINT_MAX)