Lines Matching refs:key_length
29 size_t key_length; member
43 static uint32_t lv_lru_hash(lv_lru_t * cache, const void * key, uint32_t key_length);
46 static int lv_lru_cmp_keys(lv_lru_item_t * item, const void * key, uint32_t key_length);
137 lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, void * value, size_t… in lv_lru_set() argument
145 uint32_t hash_index = lv_lru_hash(cache, key, key_length); in lv_lru_set()
150 while(item && lv_lru_cmp_keys(item, key, key_length)) { in lv_lru_set()
167 item->key = lv_mem_alloc(key_length); in lv_lru_set()
168 memcpy(item->key, key, key_length); in lv_lru_set()
170 item->key_length = key_length; in lv_lru_set()
266 static uint32_t lv_lru_hash(lv_lru_t * cache, const void * key, uint32_t key_length) in lv_lru_hash() argument
270 uint32_t h = cache->seed ^ key_length; in lv_lru_hash()
273 while(key_length >= 4) { in lv_lru_hash()
281 key_length -= 4; in lv_lru_hash()
284 if(key_length >= 3) { in lv_lru_hash()
287 if(key_length >= 2) { in lv_lru_hash()
290 if(key_length >= 1) { in lv_lru_hash()
301 static int lv_lru_cmp_keys(lv_lru_item_t * item, const void * key, uint32_t key_length) in lv_lru_cmp_keys() argument
303 if(key_length != item->key_length) { in lv_lru_cmp_keys()
307 return memcmp(key, item->key, key_length); in lv_lru_cmp_keys()