shm_mem.h File Reference

#include "../statistics.h"
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include "../dprint.h"
#include "../lock_ops.h"
#include "q_malloc.h"

Include dependency graph for shm_mem.h:

Go to the source code of this file.

Defines

#define MY_FREE   qm_free
#define MY_MALLOC   qm_malloc
#define MY_MEMINFO   qm_info
#define MY_REALLOC   qm_realloc
#define MY_STATUS   qm_status
#define shm_free(_p)
#define shm_free_unsafe(_p)   MY_FREE(shm_block, (_p))
#define shm_info(mi)
#define shm_lock()   lock_get(mem_lock)
#define shm_malloc_init   qm_malloc_init
#define shm_malloc_unsafe(_size)   MY_MALLOC(shm_block, (_size))
#define shm_resize(_p, _s)   _shm_resize( (_p), (_s))
#define shm_status()
#define shm_unlock()   lock_release(mem_lock)

Functions

void * _shm_resize (void *ptr, unsigned int size)
int shm_getmem (void)
static void * shm_malloc (unsigned int size)
void shm_mem_destroy (void)
int shm_mem_init (void)
int shm_mem_init_mallocs (void *mempool, unsigned long size)
static void * shm_realloc (void *ptr, unsigned int size)

Variables

gen_lock_t * mem_lock
struct qm_blockshm_block


Define Documentation

#define MY_FREE   qm_free

Definition at line 89 of file shm_mem.h.

#define MY_MALLOC   qm_malloc

Definition at line 88 of file shm_mem.h.

#define MY_MEMINFO   qm_info

Definition at line 92 of file shm_mem.h.

#define MY_REALLOC   qm_realloc

Definition at line 90 of file shm_mem.h.

Referenced by shm_realloc().

#define MY_STATUS   qm_status

Definition at line 91 of file shm_mem.h.

#define shm_free ( _p   ) 

Value:

do { \
      shm_lock(); \
      shm_free_unsafe( _p ); \
      shm_unlock(); \
}while(0)

Definition at line 211 of file shm_mem.h.

Referenced by __dialog_confirmed(), __dialog_destroy(), _bm_register_timer(), ac_cancel(), ac_uac_req(), add_dest2list(), add_pending_sdp_session(), add_rtpproxy_socks(), add_rule2hash(), add_sdp(), add_source(), as_relay_stat(), build_async_handler(), build_cell(), build_new_dlg(), build_new_qos_ctx(), build_rule(), clean_addresses(), clean_trusted(), cleanup(), clear_route_data(), conf_destroy(), consumeInterprocessBuffer(), cpl_exit(), cpl_invoke_script(), create_as_event_sl(), create_as_event_t(), create_bl_head(), create_carrier_data(), create_domain_data(), db_restore(), dbt_cache_destroy(), dbt_cache_get_db(), dbt_column_free(), dbt_column_new(), dbt_init_cache(), dbt_row_free(), dbt_row_new(), dbt_row_update_val(), dbt_table_free(), dbt_table_new(), delete_expired(), delete_htable(), delete_phtable(), delete_shtable(), destroy(), destroy_avp(), destroy_avp_list(), destroy_black_lists(), destroy_carrier_data(), destroy_data(), destroy_dlg(), destroy_dlg_callbacks(), destroy_dlg_callbacks_list(), destroy_dlg_profile(), destroy_dlg_table(), destroy_dlg_timer(), destroy_domain_data(), destroy_evlist(), destroy_failure_route_rule(), destroy_hash(), destroy_htable(), destroy_ip_node(), destroy_ip_tree(), destroy_linkers(), destroy_list(), destroy_phtable(), destroy_pingtable(), destroy_pua_evlist(), destroy_puacb_list(), destroy_qos(), destroy_qos_callbacks(), destroy_qos_callbacks_list(), destroy_qos_ctx(), destroy_report_queue(), destroy_route_data(), destroy_route_flags(), destroy_route_rule(), destroy_rule(), destroy_seas_stats_table(), destroy_shtable(), destroy_source_list(), destroy_timer(), destroy_tmcb_lists(), destroy_ulcb_list(), destroy_xcapcb_list(), destroy_xmpp_cb_list(), Dialog_Param_del(), Dialog_Param_new(), dispatch_relay(), dlg_bridge(), dlg_bridge_tm_callback(), dlg_confirmed_resp_uac(), dlg_new_dialog(), dlg_request_uas(), dlg_set_leg_info(), dlg_transfer(), dlg_transfer_ctx_free(), dlg_update_cseq(), dns_res_copy(), do_duplicate_rr(), do_free_params(), do_free_rr(), do_script_download(), ds_destroy_list(), empty_addr_hash_table(), empty_hash_table(), empty_location_set(), empty_tmcb_list(), free_addr_hash_table(), free_all_udomains(), free_async_handler(), free_cbparam(), free_cpl_interpreter(), free_dlg(), free_dns_res(), free_event_params(), free_hash_table(), free_location(), free_mi_node(), free_mi_tree(), free_pres_event(), free_report_cell(), free_shared_memory(), free_shm_hostent(), free_subnet_table(), free_subs_list(), free_timer_table(), free_ucontact(), free_udomain(), free_urecord(), free_xs_list(), freeInterprocessBuffer(), get_next_he(), hash_table_free(), hash_table_insert(), hash_table_install(), HashTable_del(), HashTable_new(), imc_del_member(), imc_del_room(), imc_handle_invite(), imc_htable_destroy(), imc_htable_init(), imc_inv_callback(), init_addresses(), init_dlg_table(), init_dlg_timer(), init_ip_tree(), init_seas_stats_table(), init_trusted(), initInterprocessBuffers(), insert_shtable(), lcr_hash_table_contents_free(), load_carrier_map(), load_dialog_info_from_db(), load_domain_map(), load_pcres(), lock_cleanup(), mem_copy_subs(), mem_copy_subs_noc(), mem_update_ucontact(), mi_cpl_get(), mi_set_dbg(), mi_set_queue(), mk_shm_proxy(), mod_destroy(), mod_init(), msg_list_el_free(), msg_list_free(), msg_list_init(), NAT_Contact_del(), NAT_Contact_new(), new_dlg_profile(), new_dlg_uac(), new_dlg_uas(), new_dlist(), new_htable(), new_phtable(), new_shtable(), new_ucontact(), new_udomain(), new_urecord(), parse_cluster_cfg(), pdt_free_node(), pdt_free_tree(), pdt_init_tree(), pike_exit(), publ_cback_func(), purple_free_cmd(), push_on_network(), pv_value_destroy(), register_dlgcb(), register_udomain(), reindex_dests(), reload_gws_and_lcrs(), reload_permanent_list(), remove_backed_up(), remove_location(), remove_timeout(), repl_expr_free(), request2dlg(), response2dlg(), ring_destroy_hashtable(), rls_notify_callback(), rls_send_notify(), rm_dups(), rule_fixup_recursor(), send_ack(), send_as_sms(), send_mail(), send_ping(), send_publish(), send_subscribe(), ser_free(), shm_clone_proxy(), shm_free_event(), SIP_Dialog_del(), sip_msg_cloner(), sip_resolvehost(), sl_shutdown(), sms_exit(), sst_dialog_created_CB(), sst_dialog_terminate_CB(), subs_cback_func(), t_uac(), timer_routine(), uac_cb(), uac_cleanup_cb(), update_contact(), update_db_subs(), update_filter(), update_htable(), update_phtable(), update_proxy(), update_pua(), update_pw_dialogs(), update_rlsubs(), update_route_data_recursor(), update_shtable(), update_totag_set(), update_uac_dst(), w_as_relay_sl(), w_as_relay_t(), write_log(), xj_register_watcher(), xjab_manage_sipmsg(), and xmpp_free_pipe_cmd().

#define shm_free_unsafe ( _p   )     MY_FREE(shm_block, (_p))

Definition at line 209 of file shm_mem.h.

Referenced by destroy_avp_list_unsafe(), free_cell(), and sh_realloc().

#define shm_info ( mi   ) 

Value:

do{\
   shm_lock(); \
   MY_MEMINFO(shm_block, mi); \
   shm_unlock(); \
}while(0)

Definition at line 236 of file shm_mem.h.

 
#define shm_lock (  )     lock_get(mem_lock)

Definition at line 117 of file shm_mem.h.

Referenced by free_cell(), sh_realloc(), shm_malloc(), shm_realloc(), and update_totag_set().

#define shm_malloc_init   qm_malloc_init

Definition at line 101 of file shm_mem.h.

Referenced by shm_mem_init_mallocs().

#define shm_malloc_unsafe ( _size   )     MY_MALLOC(shm_block, (_size))

Definition at line 185 of file shm_mem.h.

Referenced by sh_realloc(), shm_malloc(), shm_mem_init_mallocs(), and update_totag_set().

#define shm_resize ( _p,
_s   )     _shm_resize( (_p), (_s))

Definition at line 221 of file shm_mem.h.

Referenced by _reply_light(), pre_print_uac_request(), and relay_reply().

 
#define shm_status (  ) 

Value:

do { \
      shm_lock(); \
      MY_STATUS(shm_block); \
      shm_unlock(); \
}while(0)

Definition at line 228 of file shm_mem.h.

Referenced by cleanup(), dbg_shm_status(), and handle_sigs().

 
#define shm_unlock (  )     lock_release(mem_lock)

Definition at line 118 of file shm_mem.h.

Referenced by cleanup(), free_cell(), sh_realloc(), shm_malloc(), shm_realloc(), and update_totag_set().


Function Documentation

void* _shm_resize ( void *  ptr,
unsigned int  size 
)

Definition at line 100 of file shm_mem.c.

References LM_DBG, sh_realloc(), and shm_malloc().

int shm_getmem ( void   ) 

Definition at line 114 of file shm_mem.c.

References LM_CRIT, shm_mem_destroy(), and shm_mem_size.

Referenced by shm_mem_init().

static void* shm_malloc ( unsigned int  size  )  [inline, static]

Definition at line 187 of file shm_mem.h.

References shm_lock, shm_malloc_unsafe, and shm_unlock.

Referenced by _bm_register_timer(), _shm_resize(), a2dns_node(), ac_cancel(), ac_uac_req(), add_avp(), add_backup_rule(), add_dest2list(), add_event(), add_failure_route_rule(), add_location(), add_pending_sdp_session(), add_pua_event(), add_route_flags(), add_route_rule(), add_rtpproxy_socks(), add_rule2hash(), add_rule_to_list(), add_source(), add_to_tree(), addr_hash_table_insert(), as_relay_stat(), build_async_handler(), build_cell(), build_dlg_ack(), build_local(), build_new_dlg(), build_new_qos_ctx(), build_req_buf_from_sip_req(), build_rule(), build_uac_cancel(), build_uac_req(), build_user_AOR(), conf_init(), convertStrToCharString(), cpl_init(), create_as_action_reply(), create_as_event_sl(), create_as_event_t(), create_bl_head(), create_carrier_data(), create_domain_data(), create_mi_node(), create_ping_event(), db_restore(), dbt_cache_get_db(), dbt_column_new(), dbt_init_cache(), dbt_load_file(), dbt_row_new(), dbt_row_set_val(), dbt_row_update_val(), dbt_table_new(), Dialog_Param_new(), dlg_bridge(), dlg_set_leg_info(), dlg_transfer(), dlg_update_cseq(), dns_node_copy(), do_duplicate_params(), do_duplicate_rr(), fixup_as_relay(), get_dlg_uri(), get_user_script(), global_init(), handleContactCallbacks(), hash_table_insert(), hash_table_install(), HashTable_new(), hostent_shm_cpy(), imc_add_member(), imc_add_room(), imc_handle_invite(), imc_htable_init(), init_addresses(), init_black_lists(), init_data(), init_dlg_callback(), init_dlg_table(), init_dlg_timer(), init_evlist(), init_hash_table(), init_ip_tree(), init_mi_tree(), init_multi_proc_support(), init_pingtable(), init_pua_evlist(), init_puacb_list(), init_qos_callbacks(), init_report_queue(), init_route_data(), init_seas_stats_table(), init_source_list(), init_timer(), init_tmcb_lists(), init_trusted(), init_ulcb_list(), init_xmpp_cb_list(), initInterprocessBuffers(), insert(), insert_phtable(), insert_tmcb(), lcr_hash_table_insert(), load_carrier_map(), load_config(), load_domain_map(), load_pcres(), load_route_data_db(), lock_initialize(), main(), mem_copy_subs(), mem_copy_subs_noc(), mi_print_uris(), mi_set_dbg(), mk_shm_proxy(), mod_init(), msg_list_el_new(), msg_list_init(), NAT_Contact_new(), nathelper_add_rtpproxy_set(), new_addr_hash_table(), new_cpl_interpreter(), new_dlg_profile(), new_dlg_uac(), new_dlg_uas(), new_dlist(), new_hash_table(), new_htable(), new_ip_node(), new_phtable(), new_shtable(), new_subnet_table(), new_ucontact(), new_udomain(), new_urecord(), parse_cluster_cfg(), pdt_init_tree(), pike_init(), prefix_len_insert(), publ_cback_func(), publish_cbparam(), purple_new_cmd(), push_on_network(), reg_ex_comp(), register_dlgcb(), register_message_code_statistics(), register_puacb(), register_qoscb(), register_ulcb(), register_xcapcb(), register_xmpp_cb(), reindex_dests(), reload_route_data(), repl_exp_parse(), restore_db_subs(), ring_init_hashtable(), rls_send_notify(), rule_fixup_recursor(), run_log(), run_mail(), schedule_to_kill(), send_ping(), ser_malloc(), set_dlg_profile(), shm_clone_proxy(), shm_copy_event(), shm_copy_xcap_list(), shm_dup_cbparam(), shm_str_dup(), shm_strdup(), SIP_Dialog_new(), sip_msg_cloner(), sl_startup(), srv2dns_node(), sst_dialog_created_CB(), str_cpy(), str_to_shm(), subs_cback_func(), subs_cbparam_indlg(), subscribe_cbparam(), tm_init_timers(), uac_cb(), update_contact(), update_filter(), update_htable(), update_phtable(), update_proxy(), update_route_data(), update_route_data_recursor(), update_shtable(), w_as_relay_sl(), w_as_relay_t(), xj_register_watcher(), xjab_manage_sipmsg(), and xmpp_send_pipe_cmd().

void shm_mem_destroy ( void   ) 

Definition at line 206 of file shm_mem.c.

References LM_DBG, and shm_mem_size.

Referenced by cleanup(), shm_getmem(), and shm_mem_init_mallocs().

int shm_mem_init ( void   ) 

Definition at line 196 of file shm_mem.c.

References shm_getmem(), shm_mem_init_mallocs(), and shm_mem_size.

Referenced by init_shm_mallocs().

int shm_mem_init_mallocs ( void *  mempool,
unsigned long  size 
)

Definition at line 168 of file shm_mem.c.

References LM_CRIT, LM_DBG, shm_malloc_init, shm_malloc_unsafe, and shm_mem_destroy().

Referenced by shm_mem_init().

static void* shm_realloc ( void *  ptr,
unsigned int  size 
) [inline, static]

Definition at line 198 of file shm_mem.h.

References MY_REALLOC, shm_lock, and shm_unlock.

Referenced by Dialog_Param_add_candidate(), and ser_realloc().


Variable Documentation

gen_lock_t* mem_lock

Definition at line 67 of file shm_mem.c.

Referenced by cleanup().

Definition at line 73 of file shm_mem.c.


Generated on Thu May 24 12:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6