#include <cache.h>
Public Attributes | |
pthread_mutex_t | mutex |
char * | name |
void ** | ptr |
size_t | bufsize |
int | freetotal |
int | freecurr |
cache_constructor_t * | constructor |
cache_destructor_t * | destructor |
size_t cache_t::bufsize |
The size of each element in this cache
cache_constructor_t* cache_t::constructor |
The constructor to be called each time we allocate more memory
cache_destructor_t* cache_t::destructor |
The destructor to be called each time before we release memory
The current number of free elements
The capacity of the list of elements
pthread_mutex_t cache_t::mutex |
Mutex to protect access to the structure
char* cache_t::name |
Name of the cache objects in this cache (provided by the caller)
void** cache_t::ptr |
List of pointers to available buffers in this cache