]>
jfr.im git - solanum.git/blob - librb/include/rb_balloc.h
2 * ircd-ratbox: A slightly useful ircd.
3 * balloc.h: The ircd block allocator header.
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
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.
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.
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
24 * $Id: rb_balloc.h 26092 2008-09-19 15:13:52Z androsyn $
28 # error "Do not use balloc.h directly"
31 #ifndef INCLUDED_balloc_h
32 #define INCLUDED_balloc_h
36 typedef struct rb_bh rb_bh
;
37 typedef void rb_bh_usage_cb (size_t bused
, size_t bfree
, size_t bmemusage
, size_t heapalloc
,
38 const char *desc
, void *data
);
41 int rb_bh_free(rb_bh
*, void *);
42 void *rb_bh_alloc(rb_bh
*);
44 rb_bh
*rb_bh_create(size_t elemsize
, int elemsperblock
, const char *desc
);
45 int rb_bh_destroy(rb_bh
*bh
);
46 void rb_init_bh(void);
47 void rb_bh_usage(rb_bh
*bh
, size_t *bused
, size_t *bfree
, size_t *bmemusage
, const char **desc
);
48 void rb_bh_usage_all(rb_bh_usage_cb
*cb
, void *data
);
49 void rb_bh_total_usage(size_t *total_alloc
, size_t *total_used
);
51 #endif /* INCLUDED_balloc_h */