diff options
author | Dr.Smile <vabnick@gmail.com> | 2015-09-21 02:57:42 +0300 |
---|---|---|
committer | Dr.Smile <vabnick@gmail.com> | 2016-06-30 23:13:54 +0300 |
commit | 129f09dbb28181c254d74cf8aac98daeee744244 (patch) | |
tree | 928e8e8097c6aa5ec4557470afb74669077f80e9 /libass/ass_cache.h | |
parent | dd06ca30ea79ce50116a43cc5521d4eaf60a017e (diff) | |
download | libass-129f09dbb28181c254d74cf8aac98daeee744244.tar.bz2 libass-129f09dbb28181c254d74cf8aac98daeee744244.tar.xz |
cache: keep referenced cache values alive after ass_cache_empty()
Diffstat (limited to 'libass/ass_cache.h')
-rw-r--r-- | libass/ass_cache.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h index cd72533..687c197 100644 --- a/libass/ass_cache.h +++ b/libass/ass_cache.h @@ -103,9 +103,17 @@ typedef struct { BitmapRef *bitmaps; } CompositeHashKey; -Cache *ass_cache_create(HashFunction hash_func, HashCompare compare_func, - CacheKeyMove copy_func, CacheItemDestructor destruct_func, - size_t key_size, size_t value_size); +typedef struct +{ + HashFunction hash_func; + HashCompare compare_func; + CacheKeyMove key_move_func; + CacheItemDestructor destruct_func; + size_t key_size; + size_t value_size; +} CacheDesc; + +Cache *ass_cache_create(const CacheDesc *desc); bool ass_cache_get(Cache *cache, void *key, void *value_ptr); void *ass_cache_key(void *value); void ass_cache_commit(void *value, size_t item_size); |