Use AC_PROG_INSTALL & ./install-sh
[pgbouncer.git] / include / slab.h
blobf05ee9d1e12d3103f6f887fa7c6eaf7974b11e35
2 typedef struct ObjectCache ObjectCache;
4 typedef void (*obj_init_fn)(void *obj);
6 ObjectCache *objcache_create(const char *name, unsigned obj_size, unsigned align,
7 obj_init_fn init_func);
8 void objcache_destroy(ObjectCache *cache);
10 void * obj_alloc(ObjectCache *cache) _MALLOC _MUSTCHECK;
11 void obj_free(ObjectCache *cache, void *obj);
13 int objcache_total_count(const ObjectCache *cache);
14 int objcache_free_count(const ObjectCache *cache);
15 int objcache_active_count(const ObjectCache *cache);
17 typedef void (*slab_stat_fn)(void *arg, const char *slab_name,
18 unsigned size, unsigned free,
19 unsigned total);
20 void objcache_stats(slab_stat_fn fn, void *arg);