Lines Matching refs:head
29 lws_list_ptr_insert(lws_list_ptr *head, lws_list_ptr *add, in lws_list_ptr_insert() argument
32 while (sort_func && *head) { in lws_list_ptr_insert()
33 if (sort_func(add, *head) <= 0) in lws_list_ptr_insert()
36 head = *head; in lws_list_ptr_insert()
39 *add = *head; in lws_list_ptr_insert()
40 *head = add; in lws_list_ptr_insert()
73 lwsac_extend(struct lwsac *head, int amount) in lwsac_extend() argument
78 assert(head); in lwsac_extend()
79 lachead = (struct lwsac_head *)&head[1]; in lwsac_extend()
96 _lwsac_use(struct lwsac **head, size_t ensure, size_t chunk_size, char backfill) in _lwsac_use() argument
100 struct lwsac *bf = *head; in _lwsac_use()
133 if (!*head) in _lwsac_use()
163 if (!*head) { in _lwsac_use()
167 *head = bf; in _lwsac_use()
179 bf->head = *head; in _lwsac_use()
202 lwsac_use(struct lwsac **head, size_t ensure, size_t chunk_size) in lwsac_use() argument
204 return _lwsac_use(head, ensure, chunk_size, 0); in lwsac_use()
208 lwsac_use_backfill(struct lwsac **head, size_t ensure, size_t chunk_size) in lwsac_use_backfill() argument
210 return _lwsac_use(head, ensure, chunk_size, 1); in lwsac_use_backfill()
214 lwsac_scan_extant(struct lwsac *head, uint8_t *find, size_t len, int nul) in lwsac_scan_extant() argument
216 while (head) { in lwsac_scan_extant()
217 uint8_t *pos = (uint8_t *)&head[1], in lwsac_scan_extant()
218 *end = ((uint8_t *)head) + head->ofs - len; in lwsac_scan_extant()
220 if (head->ofs - sizeof(*head) >= len) in lwsac_scan_extant()
230 head = head->next; in lwsac_scan_extant()
237 lwsac_total_overhead(struct lwsac *head) in lwsac_total_overhead() argument
241 while (head) { in lwsac_total_overhead()
242 overhead += (head->alloc_size - head->ofs) + sizeof(*head); in lwsac_total_overhead()
244 head = head->next; in lwsac_total_overhead()
251 lwsac_use_zero(struct lwsac **head, size_t ensure, size_t chunk_size) in lwsac_use_zero() argument
253 void *p = lwsac_use(head, ensure, chunk_size); in lwsac_use_zero()
262 lwsac_free(struct lwsac **head) in lwsac_free() argument
264 struct lwsac *it = *head; in lwsac_free()
266 *head = NULL; in lwsac_free()
267 lwsl_debug("%s: head %p\n", __func__, *head); in lwsac_free()
278 lwsac_info(struct lwsac *head) in lwsac_info() argument
283 if (!head) { in lwsac_info()
288 lachead = (struct lwsac_head *)&head[1]; in lwsac_info()
290 lwsl_debug("%s: lac %p: %dKiB in %d blocks\n", __func__, head, in lwsac_info()
296 lwsac_total_alloc(struct lwsac *head) in lwsac_total_alloc() argument
300 if (!head) in lwsac_total_alloc()
303 lachead = (struct lwsac_head *)&head[1]; in lwsac_total_alloc()
308 lwsac_reference(struct lwsac *head) in lwsac_reference() argument
310 struct lwsac_head *lachead = (struct lwsac_head *)&head[1]; in lwsac_reference()
314 __func__, head, lachead->detached, lachead->refcount); in lwsac_reference()
318 lwsac_unreference(struct lwsac **head) in lwsac_unreference() argument
322 if (!(*head)) in lwsac_unreference()
325 lachead = (struct lwsac_head *)&(*head)[1]; in lwsac_unreference()
333 __func__, *head, lachead->detached, lachead->refcount); in lwsac_unreference()
336 lwsl_debug("%s: head %p: FREED\n", __func__, *head); in lwsac_unreference()
337 lwsac_free(head); in lwsac_unreference()
342 lwsac_detach(struct lwsac **head) in lwsac_detach() argument
346 if (!(*head)) in lwsac_detach()
349 lachead = (struct lwsac_head *)&(*head)[1]; in lwsac_detach()
353 lwsl_debug("%s: head %p: FREED\n", __func__, *head); in lwsac_detach()
354 lwsac_free(head); in lwsac_detach()
357 __func__, *head, lachead->refcount); in lwsac_detach()