File: slab.h

package info (click to toggle)
pgbouncer 1.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 932 kB
  • ctags: 1,085
  • sloc: ansic: 8,710; sh: 490; makefile: 213; python: 99
file content (21 lines) | stat: -rw-r--r-- 679 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

typedef struct ObjectCache ObjectCache;

typedef void (*obj_init_fn)(void *obj);

ObjectCache *objcache_create(const char *name, unsigned obj_size, unsigned align,
			     obj_init_fn init_func);
void objcache_destroy(ObjectCache *cache);

void * obj_alloc(ObjectCache *cache) _MALLOC _MUSTCHECK;
void obj_free(ObjectCache *cache, void *obj);

int objcache_total_count(const ObjectCache *cache);
int objcache_free_count(const ObjectCache *cache);
int objcache_active_count(const ObjectCache *cache);

typedef void (*slab_stat_fn)(void *arg, const char *slab_name,
			     unsigned size, unsigned free, 
			     unsigned total);
void objcache_stats(slab_stat_fn fn, void *arg);