jabberd2
2.2.16
|
Go to the source code of this file.
Defines | |
#define | _pool__malloc malloc |
#define | _pool__free free |
Functions | |
pool_t | _pool_new (char *zone, int line) |
make an empty pool | |
static void | _pool_heap_free (void *arg) |
free a heap | |
static void | _pool_cleanup_append (pool_t p, struct pfree *pf) |
mem should always be freed last | |
static struct pfree * | _pool_free (pool_t p, pool_cleanup_t f, void *arg) |
create a cleanup tracker | |
static struct pheap * | _pool_heap (pool_t p, int size) |
create a heap and make sure it get's cleaned up | |
pool_t | _pool_new_heap (int size, char *zone, int line) |
void * | pmalloc (pool_t p, int size) |
void * | pmalloc_x (pool_t p, int size, char c) |
void * | pmalloco (pool_t p, int size) |
easy safety utility (for creating blank mem for structs, etc) | |
char * | pstrdup (pool_t p, const char *src) |
XXX efficient: move this to const char * and then loop throug the existing heaps to see if src is within a block in this pool. | |
char * | pstrdupx (pool_t p, const char *src, int len) |
use given size | |
int | pool_size (pool_t p) |
void | pool_free (pool_t p) |
void | pool_cleanup (pool_t p, pool_cleanup_t f, void *arg) |
public cleanup utils, insert in a way that they are run FIFO, before mem frees | |
void | pool_stat (int full) |
#define _pool__malloc malloc |
Definition at line 39 of file pool.c.
Referenced by _pool_new(), _pool_free(), _pool_heap(), and pmalloc().
#define _pool__free free |
Definition at line 40 of file pool.c.
Referenced by _pool_heap_free(), pmalloc(), and pool_free().
pool_t _pool_new | ( | char * | zone, |
int | line | ||
) |
make an empty pool
Definition at line 45 of file pool.c.
References _pool__malloc, pool_struct::cleanup, pool_struct::heap, pool_struct::size, xhash_new(), and xhash_put().
Referenced by _pool_new_heap().
static void _pool_heap_free | ( | void * | arg | ) | [static] |
free a heap
Definition at line 72 of file pool.c.
References _pool__free, and pheap::block.
Referenced by _pool_heap().
mem should always be freed last
Definition at line 81 of file pool.c.
References pool_struct::cleanup, pool_struct::cleanup_tail, and pfree::next.
Referenced by _pool_heap(), and pmalloc().
static struct pfree* _pool_free | ( | pool_t | p, |
pool_cleanup_t | f, | ||
void * | arg | ||
) | [static, read] |
create a cleanup tracker
Definition at line 99 of file pool.c.
References _pool__malloc, pfree::f, pfree::arg, and pfree::next.
Referenced by _pool_heap(), pmalloc(), and pool_cleanup().
create a heap and make sure it get's cleaned up
Definition at line 113 of file pool.c.
References _pool__malloc, pheap::block, pheap::size, pool_struct::size, pheap::used, _pool_free(), _pool_heap_free(), pfree::heap, and _pool_cleanup_append().
Referenced by _pool_new_heap(), and pmalloc().
pool_t _pool_new_heap | ( | int | size, |
char * | zone, | ||
int | line | ||
) |
Definition at line 133 of file pool.c.
References _pool_new(), pool_struct::heap, and _pool_heap().
void* pmalloc | ( | pool_t | p, |
int | size | ||
) |
Definition at line 141 of file pool.c.
References pool_struct::heap, pheap::size, _pool__malloc, pool_struct::size, _pool_cleanup_append(), _pool_free(), _pool__free, pheap::used, _pool_heap(), and pheap::block.
Referenced by _c2s_client_sx_callback(), _dns_add_result(), _dns_add_host(), s2s_route_key(), config_load_with_id(), jqueue_push(), pmalloc_x(), pmalloco(), pstrdup(), pstrdupx(), pqueue_push(), spool_new(), _spool_add(), spool_print(), strunescape(), and strescape().
void* pmalloc_x | ( | pool_t | p, |
int | size, | ||
char | c | ||
) |
void* pmalloco | ( | pool_t | p, |
int | size | ||
) |
easy safety utility (for creating blank mem for structs, etc)
Definition at line 183 of file pool.c.
References pmalloc().
Referenced by _c2s_config_expand(), _c2s_hosts_expand(), JABBER_MAIN(), _s2s_hosts_expand(), _user_alloc(), _privacy_user_load(), _privacy_in_sess(), _template_roster_reload(), sess_start(), config_load_with_id(), jqueue_new(), pqueue_new(), xdata_new(), xdata_field_new(), xdata_item_new(), xdata_option_new(), _xdata_field_parse(), xdata_parse(), _xhash_node_new(), and xhash_new().
char* pstrdup | ( | pool_t | p, |
const char * | src | ||
) |
XXX efficient: move this to const char * and then loop throug the existing heaps to see if src is within a block in this pool.
Definition at line 191 of file pool.c.
References pmalloc().
Referenced by _c2s_client_sx_callback(), _c2s_client_accept_check(), _c2s_component_presence(), _c2s_config_expand(), _c2s_hosts_expand(), JABBER_MAIN(), _sm_hosts_expand(), _s2s_hosts_expand(), sm_register_ns(), sm_storage_rate_limit(), aci_load(), _router_process_bind(), _router_sx_callback(), _router_accept_check(), in_mio_callback(), _in_result(), out_route(), _dns_add_result(), _dns_add_host(), _out_result(), _out_verify(), s2s_db_key(), feature_register(), _privacy_user_load(), _privacy_in_sess(), config_load_with_id(), _config_expandx(), nad_new(), nad_free(), spool_add(), xdata_new(), and xdata_field_new().
char* pstrdupx | ( | pool_t | p, |
const char * | src, | ||
int | len | ||
) |
use given size
Definition at line 205 of file pool.c.
References pmalloc().
Referenced by user_table_load(), _out_dialback(), out_route(), _disco_pkt_sm_populate(), module_init(), _iq_private_in_sess(), _privacy_in_sess(), _template_roster_reload(), config_load_with_id(), xdata_option_new(), xdata_add_value(), _xdata_field_parse(), and xdata_parse().
int pool_size | ( | pool_t | p | ) |
Definition at line 219 of file pool.c.
References pool_struct::size.
void pool_free | ( | pool_t | p | ) |
Definition at line 226 of file pool.c.
References pool_struct::cleanup, pfree::f, pfree::arg, pfree::next, _pool__free, and xhash_zap().
Referenced by user_load(), user_free(), _privacy_free_z(), _privacy_in_sess(), sess_end(), sess_start(), jqueue_free(), xdata_parse(), and xhash_free().
void pool_cleanup | ( | pool_t | p, |
pool_cleanup_t | f, | ||
void * | arg | ||
) |
public cleanup utils, insert in a way that they are run FIFO, before mem frees
Definition at line 251 of file pool.c.
References _pool_free(), pfree::next, and pool_struct::cleanup.
Referenced by _c2s_client_accept_check(), sm_storage_rate_limit(), _user_alloc(), _iq_private_in_sess(), _privacy_user_load(), _privacy_in_sess(), _roster_user_load(), _template_roster_reload(), _vacation_user_load(), sess_start(), and xdata_add_value().
void pool_stat | ( | int | full | ) |
Definition at line 285 of file pool.c.
Referenced by JABBER_MAIN().