|
jabberd2
2.2.16
|
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... | |
Defines | |
| #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 _user_alloc(), _privacy_user_load(), _privacy_in_sess(), sess_start(), jqueue_new(), 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_new(), pool_struct::heap, and _pool_heap().
| JABBERD2_API void* pmalloc | ( | pool_t | , |
| 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().
| 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(), 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().
| 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_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().
| 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 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().
| 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(), 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().
| JABBERD2_API 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().
| JABBERD2_API int pool_size | ( | pool_t | p | ) |
Definition at line 219 of file pool.c.
References pool_struct::size.
1.7.5