Skip to main content

lv_cache_create

Function lv_cache_create 

Source
pub unsafe extern "C" fn lv_cache_create(
    cache_class: *const lv_cache_class_t,
    node_size: usize,
    max_size: usize,
    ops: lv_cache_ops_t,
) -> *mut lv_cache_t
Expand description

Create a cache object with the given parameters. @param cache_class The class of the cache. Currently only support one two builtin classes: - lv_cache_class_lru_rb_count for LRU-based cache with count-based eviction policy. - lv_cache_class_lru_rb_size for LRU-based cache with size-based eviction policy. @param node_size The node size is the size of the data stored in the cache.. @param max_size The max size is the maximum amount of memory or count that the cache can hold. - lv_cache_class_lru_rb_count: max_size is the maximum count of nodes in the cache. - lv_cache_class_lru_rb_size: max_size is the maximum size of the cache in bytes. @param ops A set of operations that can be performed on the cache. See lv_cache_ops_t for details. @return Returns a pointer to the created cache object on success, NULL on error.