jabberd2
2.2.17
|
Go to the source code of this file.
Data Structures | |
struct | pheap |
pheap - singular allocation of memory More... | |
struct | pfree |
pfree - a linked list node which stores an allocation chunk, plus a callback More... | |
struct | pool_struct |
pool - base node for a pool. More... |
Macros | |
#define | JABBERD2_API extern |
#define | pool_heap(i) _pool_new_heap(i,NULL,0) |
#define | pool_new() _pool_new(NULL,0) |
Typedefs | |
typedef void(* | pool_cleanup_t )(void *arg) |
pool_cleanup_t - callback type which is associated with a pool entry; invoked when the pool entry is free'd | |
typedef struct pool_struct | _pool |
pool - base node for a pool. | |
typedef struct pool_struct * | pool_t |
Functions | |
JABBERD2_API pool_t | _pool_new (char *file, int line) |
make an empty pool | |
JABBERD2_API pool_t | _pool_new_heap (int size, char *file, int line) |
JABBERD2_API void * | pmalloc (pool_t, int size) |
JABBERD2_API void * | pmalloc_x (pool_t p, int size, char c) |
JABBERD2_API void * | pmalloco (pool_t p, int size) |
easy safety utility (for creating blank mem for structs, etc) | |
JABBERD2_API 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. | |
JABBERD2_API char * | pstrdupx (pool_t p, const char *src, int len) |
use given size | |
JABBERD2_API void | pool_stat (int full) |
JABBERD2_API void | pool_cleanup (pool_t p, pool_cleanup_t fn, void *arg) |
public cleanup utils, insert in a way that they are run FIFO, before mem frees | |
JABBERD2_API void | pool_free (pool_t p) |
JABBERD2_API int | pool_size (pool_t p) |
#define pool_heap | ( | i | ) | _pool_new_heap(i,NULL,0) |
Definition at line 96 of file pool.h.
Referenced by xhash_new().
#define pool_new | ( | ) | _pool_new(NULL,0) |
Definition at line 97 of file pool.h.
Referenced by _privacy_in_sess(), _privacy_user_load(), _user_alloc(), jqueue_new(), sess_start(), and xdata_new().
typedef void(* pool_cleanup_t)(void *arg) |
typedef struct pool_struct _pool |
pool - base node for a pool.
Maintains a linked list of pool entries (pfree)
typedef struct pool_struct * pool_t |
JABBERD2_API pool_t _pool_new | ( | char * | file, |
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().
JABBERD2_API pool_t _pool_new_heap | ( | int | size, |
char * | file, | ||
int | line | ||
) |
Definition at line 133 of file pool.c.
References _pool_heap(), _pool_new(), and pool_struct::heap.
JABBERD2_API void* pmalloc | ( | pool_t | , |
int | size | ||
) |
Definition at line 141 of file pool.c.
References _pool__free, _pool__malloc, _pool_cleanup_append(), _pool_free(), _pool_heap(), pheap::block, pool_struct::heap, pheap::size, pool_struct::size, and pheap::used.
Referenced by _c2s_client_sx_callback(), _dns_add_host(), _dns_add_result(), _spool_add(), config_load_with_id(), jqueue_push(), pmalloc_x(), pmalloco(), pqueue_push(), pstrdup(), pstrdupx(), s2s_route_key(), spool_new(), spool_print(), strescape(), and strunescape().
JABBERD2_API void* pmalloc_x | ( | pool_t | p, |
int | size, | ||
char | c | ||
) |
JABBERD2_API 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(), _privacy_in_sess(), _privacy_user_load(), _s2s_hosts_expand(), _template_roster_reload(), _user_alloc(), _xdata_field_parse(), _xhash_node_new(), config_load_with_id(), JABBER_MAIN(), jqueue_new(), pqueue_new(), sess_start(), xdata_field_new(), xdata_item_new(), xdata_new(), xdata_option_new(), xdata_parse(), and xhash_new().
JABBERD2_API 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_accept_check(), _c2s_client_sx_callback(), _c2s_component_presence(), _c2s_config_expand(), _c2s_hosts_expand(), _config_expandx(), _dns_add_host(), _dns_add_result(), _in_result(), _out_result(), _out_verify(), _privacy_in_sess(), _privacy_user_load(), _router_accept_check(), _router_process_bind(), _router_sx_callback(), _s2s_hosts_expand(), _sm_hosts_expand(), aci_load(), config_load_with_id(), feature_register(), in_mio_callback(), JABBER_MAIN(), nad_free(), nad_new(), out_route(), s2s_db_key(), sm_register_ns(), sm_storage_rate_limit(), spool_add(), xdata_field_new(), and xdata_new().
JABBERD2_API 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 _disco_pkt_sm_populate(), _iq_private_in_sess(), _out_dialback(), _privacy_in_sess(), _template_roster_reload(), _xdata_field_parse(), config_load_with_id(), module_init(), out_route(), user_table_load(), xdata_add_value(), xdata_option_new(), and xdata_parse().
JABBERD2_API void pool_stat | ( | int | full | ) |
Definition at line 285 of file pool.c.
Referenced by JABBER_MAIN().
JABBERD2_API void pool_cleanup | ( | pool_t | p, |
pool_cleanup_t | fn, | ||
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(), pool_struct::cleanup, and pfree::next.
Referenced by _c2s_client_accept_check(), _iq_private_in_sess(), _privacy_in_sess(), _privacy_user_load(), _roster_user_load(), _template_roster_reload(), _user_alloc(), _vacation_user_load(), sess_start(), sm_storage_rate_limit(), and xdata_add_value().
JABBERD2_API void pool_free | ( | pool_t | p | ) |
Definition at line 226 of file pool.c.
References _pool__free, pfree::arg, pool_struct::cleanup, pfree::f, pfree::next, and xhash_zap().
Referenced by _privacy_free_z(), _privacy_in_sess(), jqueue_free(), sess_end(), sess_start(), user_free(), user_load(), xdata_parse(), and xhash_free().
JABBERD2_API int pool_size | ( | pool_t | p | ) |
Definition at line 219 of file pool.c.
References pool_struct::size.