]> jfr.im git - irc/rqf/shadowircd.git/blame - libratbox/include/rb_balloc.h
SVN Id removal part two
[irc/rqf/shadowircd.git] / libratbox / include / rb_balloc.h
CommitLineData
b57f37fb
WP
1/*
2 * ircd-ratbox: A slightly useful ircd.
3 * balloc.h: The ircd block allocator header.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2005 ircd-ratbox development team
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
22 * USA
23 *
b57f37fb
WP
24 */
25
26#ifndef RB_LIB_H
27# error "Do not use balloc.h directly"
28#endif
29
30#ifndef INCLUDED_balloc_h
31#define INCLUDED_balloc_h
32
33
34struct rb_bh;
35typedef struct rb_bh rb_bh;
94b4fbf9
VY
36typedef void rb_bh_usage_cb (size_t bused, size_t bfree, size_t bmemusage, size_t heapalloc,
37 const char *desc, void *data);
b57f37fb
WP
38
39
40int rb_bh_free(rb_bh *, void *);
41void *rb_bh_alloc(rb_bh *);
42
43rb_bh *rb_bh_create(size_t elemsize, int elemsperblock, const char *desc);
94b4fbf9 44int rb_bh_destroy(rb_bh *bh);
b57f37fb
WP
45int rb_bh_gc(rb_bh *bh);
46void rb_init_bh(void);
94b4fbf9 47void rb_bh_usage(rb_bh *bh, size_t *bused, size_t *bfree, size_t *bmemusage, const char **desc);
b57f37fb
WP
48void rb_bh_usage_all(rb_bh_usage_cb *cb, void *data);
49void rb_bh_total_usage(size_t *total_alloc, size_t *total_used);
50
51#endif /* INCLUDED_balloc_h */