Lines Matching refs:item
55 lws_cache_ttl_item_heap_t *item) in _lws_cache_heap_item_destroy() argument
58 (const char *)&item[1] + item->size); in _lws_cache_heap_item_destroy()
60 lws_dll2_remove(&item->list_expiry); in _lws_cache_heap_item_destroy()
61 lws_dll2_remove(&item->list_lru); in _lws_cache_heap_item_destroy()
63 cache->cache.current_footprint -= item->size; in _lws_cache_heap_item_destroy()
68 cache->cache.info.cb((void *)((uint8_t *)&item[1]), item->size); in _lws_cache_heap_item_destroy()
70 lws_free(item); in _lws_cache_heap_item_destroy()
75 lws_cache_ttl_item_heap_t *item, int parent_too) in lws_cache_heap_item_destroy() argument
78 const char *tag = ((const char *)&item[1]) + item->size; in lws_cache_heap_item_destroy()
102 const char *iname = ((const char *)&item[1]) + item->size; in lws_cache_heap_item_destroy()
103 uint8_t *pay = (uint8_t *)&item[1], *end = pay + item->size; in lws_cache_heap_item_destroy()
149 _lws_cache_heap_item_destroy(cache, item); in lws_cache_heap_item_destroy()
180 lws_cache_ttl_item_heap_t *item; in expiry_cb() local
182 item = lws_container_of(cache->items_expiry.head, in expiry_cb()
185 if (item->expiry > now) in expiry_cb()
188 lws_cache_heap_item_destroy(cache, item, 1); in expiry_cb()
199 lws_cache_ttl_item_heap_t *item; in earliest_expiry() local
204 item = lws_container_of(cache->items_expiry.head, in earliest_expiry()
207 *pearliest = item->expiry; in earliest_expiry()
238 lws_cache_ttl_item_heap_t *item = lws_container_of(d, in lws_cache_heap_specific() local
241 const char *iname = ((const char *)&item[1]) + item->size; in lws_cache_heap_specific()
244 return item; in lws_cache_heap_specific()
266 lws_cache_ttl_item_heap_t *item = lws_container_of(d, in lws_cache_heap_lookup() local
269 const char *iname = ((const char *)&item[1]) + item->size; in lws_cache_heap_lookup()
328 lws_cache_ttl_item_heap_t *item, *ei; in lws_cache_heap_write() local
382 item = lws_fi(&_c->info.cx->fic, "cache_write_oom") ? NULL : in lws_cache_heap_write()
383 lws_malloc(sizeof(*item) + kl + 1u + size, __func__); in lws_cache_heap_write()
384 if (!item) in lws_cache_heap_write()
387 cache->cache.current_footprint += item->size; in lws_cache_heap_write()
390 memset(item, 0, sizeof(*item)); in lws_cache_heap_write()
392 p = (char *)&item[1]; in lws_cache_heap_write()
403 item->expiry = expiry; in lws_cache_heap_write()
404 item->key_len = kl; in lws_cache_heap_write()
405 item->size = size; in lws_cache_heap_write()
409 lws_dll2_add_sorted(&item->list_expiry, &cache->items_expiry, in lws_cache_heap_write()
419 lws_dll2_add_head(&item->list_lru, &cache->items_lru); in lws_cache_heap_write()
429 lws_cache_ttl_item_heap_t *item; in lws_cache_heap_get() local
431 item = lws_cache_heap_specific(cache, specific_key); in lws_cache_heap_get()
432 if (!item) in lws_cache_heap_get()
436 lws_dll2_remove(&item->list_lru); in lws_cache_heap_get()
437 lws_dll2_add_head(&item->list_lru, &cache->items_lru); in lws_cache_heap_get()
440 *pdata = (const void *)&item[1]; in lws_cache_heap_get()
441 *psize = item->size; in lws_cache_heap_get()
452 lws_cache_ttl_item_heap_t *item; in lws_cache_heap_invalidate() local
462 item = (lws_cache_ttl_item_heap_t *)(((uint8_t *)user) - sizeof(*item)); in lws_cache_heap_invalidate()
491 lws_cache_heap_item_destroy(cache, item, 0); in lws_cache_heap_invalidate()
523 lws_cache_ttl_item_heap_t *item = in destroy_dll() local
526 lws_cache_heap_item_destroy(cache, item, 0); in destroy_dll()
561 lws_cache_ttl_item_heap_t *item = in dump_dll() local
565 (const char *)&item[1] + item->size, in dump_dll()
566 (int)item->size, (unsigned long long)item->expiry); in dump_dll()
568 lwsl_hexdump_cache((const char *)&item[1], item->size); in dump_dll()
578 lws_cache_ttl_item_heap_t *item = NULL; in lws_cache_heap_debug_dump() local
583 item = lws_container_of(d, lws_cache_ttl_item_heap_t, in lws_cache_heap_debug_dump()
588 item ? (unsigned long long)item->expiry : 0ull); in lws_cache_heap_debug_dump()