Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (24 sloc) 1.133 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@*/
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored
20 void *do_slabs_alloc(const size_t size);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
21
516e7dc Minimal doxygen configuration
Paul Lindner authored
22 /** Free previously allocated object */
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored
23 void do_slabs_free(void *ptr, size_t size);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
24
516e7dc Minimal doxygen configuration
Paul Lindner authored
25 /** Fill buffer with stats */ /*@null@*/
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored
26 char* do_slabs_stats(int *buflen);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
27
28 /* Request some slab be moved between classes
29 1 = success
30 0 = fail
31 -1 = tried. busy. send again shortly. */
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored
32 int do_slabs_reassign(unsigned char srcid, unsigned char dstid);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored
33
Something went wrong with that request. Please try again.