MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / queue_new

Function queue_new

util/queue.c:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34} queue_entry_type;
35
36queue_type *queue_new()
37{
38 queue_type *q;
39 q = malloc(sizeof(queue_type));
40 if (q == 0)
41 return 0;
42 q->pent = pool_init(sizeof(queue_entry_type), 64);
43 if (q->pent == 0) {
44 free(q);
45 return 0;
46 }
47 listc_init(&q->lst, offsetof(queue_entry_type, lnk));
48 return q;
49}
50
51/*return all resources for queue*/
52void queue_free(queue_type *q)

Callers 5

mainFunction · 0.85
mainFunction · 0.85
osqlpfthdpool_initFunction · 0.85
_shard_connectFunction · 0.85

Calls 4

mallocFunction · 0.85
pool_initFunction · 0.85
freeFunction · 0.85
listc_initFunction · 0.85

Tested by 1

mainFunction · 0.68