let mrucache age return how much elements it couldn't purge

This commit is contained in:
Christian Thaeter 2008-03-27 11:58:38 +01:00
parent 328127980a
commit eab6b64f6d
2 changed files with 7 additions and 5 deletions

View file

@ -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;
}

View file

@ -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