MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_prio_queue_create

Function rt_prio_queue_create

components/vbus/prio_queue.c:105–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104#ifdef RT_USING_HEAP
105struct rt_prio_queue* rt_prio_queue_create(const char *name,
106 rt_size_t item_nr,
107 rt_size_t item_sz)
108{
109 struct rt_prio_queue *que;
110 rt_size_t bufsz;
111
112 bufsz = item_nr * (sizeof(struct rt_prio_queue_item)
113 + item_sz
114 + sizeof(void*));
115
116 RT_ASSERT(item_nr);
117
118 que = rt_malloc(sizeof(*que) + bufsz);
119 if (!que)
120 return RT_NULL;
121
122 rt_prio_queue_init(que, name, que+1, bufsz, item_sz);
123
124 return que;
125}
126
127void rt_prio_queue_delete(struct rt_prio_queue *que)
128{

Callers 1

_bus_out_entryFunction · 0.85

Calls 2

rt_mallocFunction · 0.85
rt_prio_queue_initFunction · 0.85

Tested by

no test coverage detected