shapito: add shapito_cache_stat()

This commit is contained in:
Dmitry Simonenko 2018-02-12 16:28:46 +03:00
parent 258eb09535
commit 00dc09ae5f
1 changed files with 9 additions and 0 deletions

View File

@ -78,4 +78,13 @@ shapito_cache_push(shapito_cache_t *cache, shapito_stream_t *stream)
pthread_spin_unlock(&cache->lock);
}
static inline void
shapito_cache_stat(shapito_cache_t *cache, int *count, int *count_allocated)
{
pthread_spin_lock(&cache->lock);
*count = cache->count;
*count_allocated = cache->count_allocated;
pthread_spin_unlock(&cache->lock);
}
#endif /* SHAPITO_CACHE_H */