/* remove an item and push it to the free items queue  */
static void lv_lru_remove_item(lv_lru_t *cache, lv_lru_item_t *prev, lv_lru_item_t *item, uint32_t hash_index)
/* remove an item and push it to the free items queue  */
static void lv_lru_remove_item(lv_lru_t *cache, lv_lru_item_t *prev, lv_lru_item_t *item, uint32_t hash_index)
{
    if(prev) {
        prev->next = item->next;
    }
    else {
        cache->items[hash_index] = (lv_lru_item_t *) item->next;
    }
    cache->free_memory += item->value_length;
    cache->value_free(item->value);
    cache->key_free(item->key);
    lv_memzero(item, sizeof(lv_lru_item_t));
    item->next = cache->free_items;
    cache->free_items = item;
}