lv_cache.h
API reference for lv_cache.h
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_cache_private.h
Summary
Functions
misc/cache/lv_cache.h:146function
lv_cache_set_max_size
Set the maximum size of the cache. If the current cache size is greater than the new maximum size, the cache's policy will be used to evict entries until the new maximum size is reached. If set to 0, the cache will be disabled.
void lv_cache_set_max_size(lv_cache_t *cache, size_t max_size, void *user_data)| Name | Type | Description |
|---|---|---|
cache | lv_cache_t * | The cache object pointer to set the maximum size. |
max_size | size_t | The new maximum size of the cache. |
user_data | void * | A user data pointer that will be passed to the free callback. |
But this behavior will happen only new entries are added to the cache.
misc/cache/lv_cache.h:186function
lv_cache_set_compare_cb
Set the compare callback of the cache.
void lv_cache_set_compare_cb(lv_cache_t *cache, lv_cache_compare_cb_t compare_cb, void *user_data)| Name | Type | Description |
|---|---|---|
cache | lv_cache_t * | The cache object pointer to set the compare callback. |
compare_cb | lv_cache_compare_cb_t | The compare callback to set. |
user_data | void * | A user data pointer. |
misc/cache/lv_cache.h:194function
lv_cache_set_create_cb
Set the create callback of the cache.
void lv_cache_set_create_cb(lv_cache_t *cache, lv_cache_create_cb_t alloc_cb, void *user_data)| Name | Type | Description |
|---|---|---|
cache | lv_cache_t * | The cache object pointer to set the create callback. |
alloc_cb | lv_cache_create_cb_t | The create callback to set. |
user_data | void * | A user data pointer. |
misc/cache/lv_cache.h:202function
lv_cache_set_free_cb
Set the free callback of the cache.
void lv_cache_set_free_cb(lv_cache_t *cache, lv_cache_free_cb_t free_cb, void *user_data)| Name | Type | Description |
|---|---|---|
cache | lv_cache_t * | The cache object pointer to set the free callback. |
free_cb | lv_cache_free_cb_t | The free callback to set. |
user_data | void * | A user data pointer. |
misc/cache/lv_cache.h:209function
lv_cache_set_name
Give a name for a cache object. Only the pointer of the string is saved.
void lv_cache_set_name(lv_cache_t *cache, const char *name)| Name | Type | Description |
|---|---|---|
cache | lv_cache_t * | The cache object pointer to set the name. |
name | const char * | The name of the cache. |
Dependencies
How is this guide?
Last updated on