diff --git a/src/lib/mrucache.c b/src/lib/mrucache.c index 15b38d1d1..ebe9ef71b 100644 --- a/src/lib/mrucache.c +++ b/src/lib/mrucache.c @@ -56,10 +56,12 @@ lumiera_mrucache_destroy (LumieraMruCache self) /** * destroy and free the nelem oldest elements */ -void -lumiera_mrucache_age (LumieraMruCache self, size_t nelem) +int +lumiera_mrucache_age (LumieraMruCache self, size_t int) { REQUIRE (self); while (self->cached && nelem--) free (lumiera_mrucache_pop (self)); + + return nelem; } diff --git a/src/lib/mrucache.h b/src/lib/mrucache.h index 4802ed6a1..8af7434d9 100644 --- a/src/lib/mrucache.h +++ b/src/lib/mrucache.h @@ -36,7 +36,7 @@ * Callback function used to destruct/cleanup aged elements. * shall clean the element sufficiently up to be ready for being freed or reused * @param node the llist node used to link cache elements (will be empty at call) - * @return pointer to the begin of the element + * @return pointer to the begin of the element. */ typedef void* (*lumiera_cache_destructor_fn)(LList node); @@ -112,8 +112,8 @@ lumiera_mrucache_pop (LumieraMruCache self) /** * destroy and free the nelem oldest elements */ -void -lumiera_mrucache_age (LumieraMruCache self, size_t nelem); +int +lumiera_mrucache_age (LumieraMruCache self, int nelem); #endif