64 #define ref_init( refcnt, free ) do { \ 65 if ( __builtin_constant_p ( (free) ) && ( (free) == NULL ) ) { \ 68 ref_init ( (refcnt), (free) ); \ 77 #define REF_INIT( free_fn ) { \ 92 #define ref_get( refcnt ) ( { \ 94 assert ( (refcnt)->count >= 0 ); \ 95 ref_increment ( refcnt ); \ 106 #define ref_put( refcnt ) do { \ 108 assert ( (refcnt)->count >= 0 ); \ 109 ref_decrement ( refcnt ); \ void ref_decrement(struct refcnt *refcnt)
Decrement reference count.
#define ref_init(refcnt, free)
Initialise a reference counter.
void ref_no_free(struct refcnt *refcnt)
static void(*) struct refcnt refcnt)
int count
Current reference count.
static void(* free)(struct refcnt *refcnt))
static __attribute__((always_inline)) void ref_init(struct refcnt *refcnt
Initialise a reference counter.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void ref_increment(struct refcnt *refcnt)
Increment reference count.
void(* free)(struct refcnt *refcnt)
Free containing object.