Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (26 sloc) 1.251 kb
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
1 /* slabs memory allocation */
2
516e7dc Minimal doxygen configuration
Paul Lindner authored
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
a6b35b4 Enable use of large memory pages (Trond Norbye) <Trond.Norbye@Sun.COM>
Trond Norbye authored
5 size equal to the previous slab's chunk size times this factor.
6 3rd argument specifies if the slab allocator should allocate all memory
7 up front (if true), or allocate memory in chunks as it is needed (if false)
8 */
9 void slabs_init(const size_t limit, const double factor, const bool prealloc);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
10
11
516e7dc Minimal doxygen configuration
Paul Lindner authored
12 /**
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
13 * Given object size, return id to use when allocating/freeing memory for object
14 * 0 means error: can't store such a large object
15 */
16
17 unsigned int slabs_clsid(const size_t size);
18
516e7dc Minimal doxygen configuration
Paul Lindner authored
19 /** Allocate object of given length. 0 on error */ /*@null@*/
01fa48f @dormando Don't re-calculate the slab class id.
dormando authored
20 void *do_slabs_alloc(const size_t size, unsigned int id);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
21
516e7dc Minimal doxygen configuration
Paul Lindner authored
22 /** Free previously allocated object */
8d3ac82 @dormando Don't re-calculate the slab class id for slabs_free() either.
dormando authored
23 void do_slabs_free(void *ptr, size_t size, unsigned int id);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
24
4c77f59 Initial attempt of supporting stats in binary protocol.
Toru Maesaka authored
25 /** Fill and return the requested stats */
26 char *get_stats(const char *stat_type);
27
516e7dc Minimal doxygen configuration
Paul Lindner authored
28 /** Fill buffer with stats */ /*@null@*/
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored
29 char* do_slabs_stats(int *buflen);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
30
31 /* Request some slab be moved between classes
32 1 = success
33 0 = fail
34 -1 = tried. busy. send again shortly. */
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored
35 int do_slabs_reassign(unsigned char srcid, unsigned char dstid);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
36
Something went wrong with that request. Please try again.