Lines Matching refs:cs
22 static struct comm_str *comm_str__get(struct comm_str *cs) in comm_str__get() argument
24 if (cs && refcount_inc_not_zero(&cs->refcnt)) in comm_str__get()
25 return cs; in comm_str__get()
30 static void comm_str__put(struct comm_str *cs) in comm_str__put() argument
32 if (cs && refcount_dec_and_test(&cs->refcnt)) { in comm_str__put()
34 rb_erase(&cs->rb_node, &comm_str_root); in comm_str__put()
36 zfree(&cs->str); in comm_str__put()
37 free(cs); in comm_str__put()
43 struct comm_str *cs; in comm_str__alloc() local
45 cs = zalloc(sizeof(*cs)); in comm_str__alloc()
46 if (!cs) in comm_str__alloc()
49 cs->str = strdup(str); in comm_str__alloc()
50 if (!cs->str) { in comm_str__alloc()
51 free(cs); in comm_str__alloc()
55 refcount_set(&cs->refcnt, 1); in comm_str__alloc()
57 return cs; in comm_str__alloc()
99 struct comm_str *cs; in comm_str__findnew() local
102 cs = __comm_str__findnew(str, root); in comm_str__findnew()
105 return cs; in comm_str__findnew()