]> jfr.im git - irc/rqf/shadowircd.git/blame - libratbox/include/rb_balloc.h
Removal of ancient SVN ID's part one
[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 *
94b4fbf9 24 * $Id: rb_balloc.h 26092 2008-09-19 15:13:52Z androsyn $
b57f37fb
WP
25 */
26
27#ifndef RB_LIB_H
28# error "Do not use balloc.h directly"
29#endif
30
31#ifndef INCLUDED_balloc_h
32#define INCLUDED_balloc_h
33
34
35struct rb_bh;
36typedef struct rb_bh rb_bh;
94b4fbf9
VY
37typedef void rb_bh_usage_cb (size_t bused, size_t bfree, size_t bmemusage, size_t heapalloc,
38 const char *desc, void *data);
b57f37fb
WP
39
40
41int rb_bh_free(rb_bh *, void *);
42void *rb_bh_alloc(rb_bh *);
43
44rb_bh *rb_bh_create(size_t elemsize, int elemsperblock, const char *desc);
94b4fbf9 45int rb_bh_destroy(rb_bh *bh);
b57f37fb
WP
46int rb_bh_gc(rb_bh *bh);
47void rb_init_bh(void);
94b4fbf9 48void rb_bh_usage(rb_bh *bh, size_t *bused, size_t *bfree, size_t *bmemusage, const char **desc);
b57f37fb
WP
49void rb_bh_usage_all(rb_bh_usage_cb *cb, void *data);
50void rb_bh_total_usage(size_t *total_alloc, size_t *total_used);
51
52#endif /* INCLUDED_balloc_h */