Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (36 sloc) 1.626 kb
5fe65a2 squashed warnings in memcached
ttung authored
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
3 #if !defined(_slabs_h_)
4 #define _slabs_h_
5
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
6 /* slabs memory allocation */
7
29f030a Update with the latest changes from the public memcached source
sgrimm authored
8 /** Init the subsystem. 1st argument is the limit on no. of bytes to allocate,
9 0 if no limit. 2nd argument is the growth factor; each slab will use a chunk
10 size equal to the previous slab's chunk size times this factor. */
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
11 void slabs_init(const size_t limit, const double factor);
12
13
29f030a Update with the latest changes from the public memcached source
sgrimm authored
14 /**
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
15 * Given object size, return id to use when allocating/freeing memory for object
16 * 0 means error: can't store such a large object
17 */
18
19 unsigned int slabs_clsid(const size_t size);
68d5f2e timestamp memcached k:v pairs
ttung authored
20 unsigned int slabs_chunksize(const unsigned int clsid);
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
21
29f030a Update with the latest changes from the public memcached source
sgrimm authored
22 /** Allocate object of given length. 0 on error */ /*@null@*/
111846a Merge multithreaded into trunk, commit #2 (first commit only did the
sgrimm authored
23 void *do_slabs_alloc(const size_t size);
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
24
29f030a Update with the latest changes from the public memcached source
sgrimm authored
25 /** Free previously allocated object */
111846a Merge multithreaded into trunk, commit #2 (first commit only did the
sgrimm authored
26 void do_slabs_free(void *ptr, size_t size);
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
27
29f030a Update with the latest changes from the public memcached source
sgrimm authored
28 /** Fill buffer with stats */ /*@null@*/
111846a Merge multithreaded into trunk, commit #2 (first commit only did the
sgrimm authored
29 char* do_slabs_stats(int *buflen);
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
30
31 /* Request some slab be moved between classes
32 1 = success
33 0 = fail
34 -1 = tried. busy. send again shortly. */
111846a Merge multithreaded into trunk, commit #2 (first commit only did the
sgrimm authored
35 int do_slabs_reassign(unsigned char srcid, unsigned char dstid);
3459576 multiple cleanups/refactoring, see ChangeLog
plindner authored
36
5fe65a2 squashed warnings in memcached
ttung authored
37 void slabs_add_hit(void *it, int unique);
38 void slabs_add_eviction(unsigned int clsid);
39
68d5f2e timestamp memcached k:v pairs
ttung authored
40 /* Find the worst performed slab class to free one slab from it and
9a4b002 [memcache] added slab reallocation
hzhao authored
41 assign it to the best performed slab class. */
5fe65a2 squashed warnings in memcached
ttung authored
42 void do_slabs_rebalance();
9a4b002 [memcache] added slab reallocation
hzhao authored
43
44 /* 0 to turn off rebalance_interval; otherwise, this number is in seconds.
45 * These two functions are actually implemented in items.c.
46 */
47 void slabs_set_rebalance_interval(int interval);
48 int slabs_get_rebalance_interval();
5fe65a2 squashed warnings in memcached
ttung authored
49 #endif /* #if !defined(_slabs_h_) */
Something went wrong with that request. Please try again.