lv_cache_set_max_size() function
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.
Arguments
cache
The cache object pointer to set the maximum size.
max_size
The new maximum size of the cache.
user_data
A user data pointer that will be passed to the free callback.
Notes
But this behavior will happen only new entries are added to the cache.