comparison slabs.h @ 0:30782bb1fc04 MEMCACHED_1_2_3

memcached-1.2.3
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 23 Sep 2007 03:58:34 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:30782bb1fc04
1 /* slabs memory allocation */
2
3 /* Init the subsystem. 1st argument is the limit on no. of bytes to allocate,
4 0 if no limit. 2nd argument is the growth factor; each slab will use a chunk
5 size equal to the previous slab's chunk size times this factor. */
6 void slabs_init(const size_t limit, const double factor);
7
8
9 /*
10 * Given object size, return id to use when allocating/freeing memory for object
11 * 0 means error: can't store such a large object
12 */
13
14 unsigned int slabs_clsid(const size_t size);
15
16 /* Allocate object of given length. 0 on error */ /*@null@*/
17 void *do_slabs_alloc(const size_t size);
18
19 /* Free previously allocated object */
20 void do_slabs_free(void *ptr, size_t size);
21
22 /* Fill buffer with stats */ /*@null@*/
23 char* do_slabs_stats(int *buflen);
24
25 /* Request some slab be moved between classes
26 1 = success
27 0 = fail
28 -1 = tried. busy. send again shortly. */
29 int do_slabs_reassign(unsigned char srcid, unsigned char dstid);
30