diff options
-rw-r--r-- | common/bo-cache.c | 2 | ||||
-rw-r--r-- | common/bo-cache.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/common/bo-cache.c b/common/bo-cache.c index d2ba0a3..6312f8f 100644 --- a/common/bo-cache.c +++ b/common/bo-cache.c @@ -31,7 +31,7 @@ static size_t bucket_size[NUM_BUCKETS] = { 3686400, 8294400, 8388608, }; -void bo_cache_init(struct bo_cache *cache, void (*free)(struct bo_entry *)) +void bo_cache_init(struct bo_cache *cache, bo_free_fn_t *free) { struct timespec time; unsigned i; diff --git a/common/bo-cache.h b/common/bo-cache.h index b397827..7d72e6c 100644 --- a/common/bo-cache.h +++ b/common/bo-cache.h @@ -12,6 +12,8 @@ struct bo_cache; struct bo_entry; +typedef void bo_free_fn_t(struct bo_entry *); + struct bo_bucket { struct xorg_list head; size_t size; @@ -21,7 +23,7 @@ struct bo_cache { struct bo_bucket buckets[NUM_BUCKETS]; struct xorg_list head; time_t last_cleaned; - void (*free)(struct bo_entry *); + bo_free_fn_t *free; }; struct bo_entry { @@ -31,7 +33,7 @@ struct bo_entry { time_t free_time; }; -void bo_cache_init(struct bo_cache *cache, void (*free)(struct bo_entry *)); +void bo_cache_init(struct bo_cache *cache, bo_free_fn_t *free); void bo_cache_fini(struct bo_cache *cache); struct bo_bucket *bo_cache_bucket_find(struct bo_cache *cache, size_t size); struct bo_entry *bo_cache_bucket_get(struct bo_bucket *bucket); |