File ut/memwrap.c

  $Revision: 1.15 $

Utilities (ut). memwrap.c - memory allocation wrappers. Facilitate easy changing a memory allocation library and provide uniform error codes.
Status: NOT REVUED, TESTED,
Design and implementation by: Marek Bukowy

Included Files


Preprocessor definitions

#define USE_LOGGING

Global Variable Lock

pthread_mutex_t Lock
Included from /home/shane/release/RIP/include/ca_defs.h
Visible in:  aa/aa.c
   ac/ac_persistence.c
   ac/access_control.c
   au/AU_util.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
   pw/protocol_whois.c
   qc/mg_getopt.c
   qc/query_command.c
   qi/query_instructions.c
   rp/rp_convert.c
   rp/rp_load.c
   rp/rp_search.c
   rp/rp_tree.c
   rp/rp_update.c
   rx/rx_node.c
   rx/rx_print.c
   rx/rx_search.c
   rx/rx_tree.c
   sk/cd_socket.c
   sk/cd_watchdog.c
   sk/sk_socket.c
   sq/mysql_driver.c
   sv/server.c
   ta/ta.c
   th/thread.c
   ud/ud_comrol.c
   ud/ud_core.c
   ud/ud_main.c
   ud/ud_misc.c
   ud/ud_process_stream.c
   ud/ud_recover.c
   ud/ud_rx.c
   ud/ud_serial.c
   up/UP_extrnl_syntax.c
   up/UP_util.c
   ut/fdwrap.c
   ut/memwrap.c
Used in: ca_get_adminIntElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_boolean()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_int()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_set_boolean()ca/ca_configFns.c
  ca_srchandle2Intelement()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c

Local Variables

UT_memory_logging
static int UT_memory_logging
Used in: UT_alloc_log()
  UT_free_log()
  UT_memory_log()

Global Function UT_calloc_real()

void* UT_calloc_real ( size_t num, size_t size, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: ER_perror()er/er.c
  UT_alloc_log()ut/memwrap.c
  calloc(), fprintf()
Called by: AC_findcreate_acl_l()ac/access_control.c
  CO_set()co/constants.c
  IP_rang_decomp()ip/ip.c
  IP_rang_t2b()ip/ip.c
  NH_parse()nh/nh.c
  QC_create()qc/query_command.c
  QC_environ_new()qc/query_command.c
  QC_fill()qc/query_command.c
  QI_new()qi/query_instructions.c
  RP_uni_node_l()rp/rp_update.c
  RX_bin_search()rx/rx_search.c
  SV_concurrent_server()sv/server.c
  UD_do_nrtm()ud/ud_main.c
  add_property()pr/properties.c
  ca_readConfig()ca/ca_configFns.c
  ca_readSources()ca/ca_sourceLoader.c
  er_add_exec_arg()er/er_paths.c
  er_register_path()er/er_paths.c
  mg_new()qc/mg_getopt.c
  rp_asc_append_datref()rp/rp_search.c
  rx_creat_node()rx/rx_node.c
  ta_findcreate_l()ta/ta.c
  transaction_new()ud/ud_misc.c
  wr_real_calloc()ut/memwrap.c

Global Function UT_free_real()

void UT_free_real ( void* ptr, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_free_log()ut/memwrap.c
  free()
Called by: AC_acc_load()ac/access_control.c
  AC_acl_sql()ac/access_control.c
  AC_asc_acl_command_set()ac/access_control.c
  AC_dbopen_admin()ac/access_control.c
  AC_persistence_load()ac/ac_persistence.c
  AC_persistence_save_l()ac/ac_persistence.c
  AC_print_access()ac/access_control.c
  AC_print_acl()ac/access_control.c
  CO_set()co/constants.c
  CO_to_string()co/constants.c
  ER_macro_spec()er/er_macro.c
  ER_make_macro()er/er_macro.c
  ER_proc_ca_err()er/er_macro.c
  ER_proc_ca_macro()er/er_macro.c
  IP_rang_t2b()ip/ip.c
  IP_smart_conv()ip/ip.c
  NH_convert()nh/nh.c
  NH_parse()nh/nh.c
  PC_interact()pc/protocol_config.c
  PM_get_minmax_serial()pm/pm_serials.c
  PM_get_nrtm_sources()pm/pm_serials.c
  PM_get_serial_object()pm/pm_serials.c
  PM_interact()pm/protocol_mirror.c
  PR_load()pr/properties.c
  PW_interact()pw/protocol_whois.c
  PW_process_qc()pw/protocol_whois.c
  QC_create()qc/query_command.c
  QC_environ_free()qc/query_command.c
  QC_environ_new()qc/query_command.c
  QC_environ_to_string()qc/query_command.c
  QC_fill()qc/query_command.c
  QC_free()qc/query_command.c
  QC_query_command_to_string()qc/query_command.c
  QI_execute()qi/query_instructions.c
  QI_free()qi/query_instructions.c
  QI_new()qi/query_instructions.c
  RP_sql_load_attr_space()rp/rp_load.c
  RP_sql_load_reg()rp/rp_load.c
  RP_tree_add()rp/rp_tree.c
  RP_uni_node_l()rp/rp_update.c
  SK_cd_free()sk/cd_socket.c
  SK_cd_printf()sk/cd_socket.c
  SQ_get_table_size()sq/mysql_driver.c
  SV_do_child()sv/server.c
  SV_start()sv/server.c
  UD_check_ref()ud/ud_comrol.c
  UD_do_nrtm()ud/ud_main.c
  UD_do_updates()ud/ud_main.c
  VerifySignAndExplodeFile()pa/gpg.c
  ac_rxwalkhook_print()ac/access_control.c
  ac_rxwalkhook_print_acl()ac/access_control.c
  atlast()pm/pm_serials.c
  auth_member_of()ud/ud_core.c
  ca_readConfig()ca/ca_configFns.c
  ca_set_dirlist()ca/ca_configFns.c
  command_execute()pc/protocol_config.c
  convert_as_range()ud/ud_core.c
  convert_if()ud/ud_core.c
  convert_rf()ud/ud_core.c
  create_asblock_query()qi/query_instructions.c
  create_attr()ud/ud_core.c
  create_dummy()ud/ud_core.c
  display_file()pw/protocol_whois.c
  do_regex_test()mm/mm.c
  er_add_exec_arg()er/er_paths.c
  er_delete_filter()er/er_paths.c
  er_delete_path()er/er_paths.c
  er_free_dynadescr()er/er_paths.c
  er_path_safeguard()er/er_paths.c
  find_command()pc/protocol_config.c
  free_nh()nh/nh.c
  get_mail_hdr_field()mm/mm.c
  get_object_id()ud/ud_core.c
  get_qresult_str()ud/ud_core.c
  get_range()nh/nh.c
  get_ref_id()ud/ud_core.c
  get_sequence_id()ud/ud_core.c
  getop()pm/pm_serials.c
  insert_radix_serials()qi/query_instructions.c
  instruction_free()qi/query_instructions.c
  is_supported_MIMEtype()mm/mm.c
  isdummy()ud/ud_core.c
  log_command()qc/query_command.c
  mnt_irt_filter()qi/query_instructions.c
  mycleanup()er/er.yacc.tab.c
  nfslock()pa/spawn.c
  nfsunlock()pa/spawn.c
  object_process()ud/ud_core.c
  parse_message_rfc822()mm/mm.c
  parse_multipart_alternative()mm/mm.c
  parse_multipart_signed()mm/mm.c
  parse_request()pm/protocol_mirror.c
  parse_text_plain()mm/mm.c
  pm_get_source_info()pm/pm_serials.c
  purge_properties()pr/properties.c
  pw_log_query()pw/protocol_whois.c
  qi_fetch_references()qi/query_instructions.c
  qi_prep_run_refer()qi/query_instructions.c
  run_referral()qi/query_instructions.c
  rx_delete_dataleaves()rx/rx_tree.c
  rx_delete_node()rx/rx_node.c
  rx_delete_treenode()rx/rx_tree.c
  set_err()pc/pc_commands.c
  show_const()pc/pc_commands.c
  show_consts()pc/pc_commands.c
  show_err()pc/pc_commands.c
  show_props()pc/pc_commands.c
  show_threads()pc/pc_commands.c
  sq_get_minmax_id()sq/mysql_driver.c
  ta_printone_l()ta/ta.c
  transaction_free()ud/ud_misc.c
  ud_replace_autonic()ud/ud_process_stream.c
  update_attr()ud/ud_core.c
  wr_real_free()ut/memwrap.c
  write_radix_immediate()qi/query_instructions.c
  write_results()qi/query_instructions.c

Global Function UT_malloc_real()

void* UT_malloc_real ( size_t size, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: ER_perror()er/er.c
  UT_alloc_log()ut/memwrap.c
  fprintf(), malloc()
Called by: AC_acc_load()ac/access_control.c
  AC_acl_sql()ac/access_control.c
  AC_credit_to_string()ac/access_control.c
  AC_findcreate_account_l()ac/access_control.c
  AC_persistence_get_leaves_hook_l()ac/ac_persistence.c
  AC_persistence_load()ac/ac_persistence.c
  AddKeyInfo()ep/mail_parser.c
  EP_DefineNewNode()ep/mail_parser.c
  EP_DefineNewToken()ep/mail_parser.c
  EP_InitializeNode()ep/mail_parser.c
  EP_InitializeRootNode()ep/mail_parser.c
  ER_parse_spec()er/er.yacc.tab.c
  IP_rang_decomp()ip/ip.c
  IP_smart_conv()ip/ip.c
  InitializeMailDescr()ep/mail_parser.c
  MM_get_msg_headers()mm/mm.c
  NH_parse()nh/nh.c
  QI_queries_to_string()qi/query_instructions.c
  RP_sql_load_attr_space()rp/rp_load.c
  RP_tree_add()rp/rp_tree.c
  RP_uni_node_l()rp/rp_update.c
  RX_tree_cre()rx/rx_tree.c
  SK_cd_printf()sk/cd_socket.c
  SK_getpeername()sk/sk_socket.c
  SQ_escape_string()sq/mysql_driver.c
  SQ_get_column_string()sq/mysql_driver.c
  TA_tostring()ta/ta.c
  UT_strdup_real()ut/memwrap.c
  ac_acl_to_string()ac/access_control.c
  ac_acl_to_string_header()ac/access_control.c
  ac_to_string()ac/access_control.c
  ac_to_string_header()ac/access_control.c
  ca_change_int_value()ca/ca_configFns.c
  ca_readConfig()ca/ca_configFns.c
  ca_set_dirlist()ca/ca_configFns.c
  display_file()pw/protocol_whois.c
  do_regex_test()mm/mm.c
  er_add_filter()er/er_paths.c
  get_header_line()mm/mm.c
  get_mail_hdr_field()mm/mm.c
  init_name2type_hash()df/defs.c
  is_supported_MIMEtype()mm/mm.c
  main_loop()sv/server.c
  nfslock()pa/spawn.c
  nfsunlock()pa/spawn.c
  parse_message_rfc822()mm/mm.c
  parse_multipart_alternative()mm/mm.c
  parse_multipart_signed()mm/mm.c
  parse_text_plain()mm/mm.c
  rx_nod_append()rx/rx_search.c
  show_boolean()co/constants.c
  show_int()co/constants.c
  up_add_inet6num_attrs()up/UP_extrnl_syntax.c
  wr_real_malloc()ut/memwrap.c

Global Function UT_memory_log()

void UT_memory_log ( int active )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Called by: wr_log_set()ut/memwrap.c
References Variables: UT_memory_loggingut/memwrap.c

Global Function UT_realloc_real()

void* UT_realloc_real ( void* ptr, size_t size, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: ER_perror()er/er.c
  UT_alloc_log()ut/memwrap.c
  UT_free_log()ut/memwrap.c
  fprintf(), realloc()
Called by: QI_queries_to_string()qi/query_instructions.c
  TA_tostring()ta/ta.c
  wr_real_realloc()ut/memwrap.c

Global Function UT_strdup_real()

char* UT_strdup_real ( const char* str, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_malloc_real()ut/memwrap.c
  strcpy(), strlen()
Called by: AC_asc_acl_command_set()ac/access_control.c
  CO_to_string()co/constants.c
  ER_macro_spec()er/er_macro.c
  ER_make_macro()er/er_macro.c
  MA_to_string()ma/bitmask.c
  PR_get_property()pr/properties.c
  PR_load()pr/properties.c
  PR_set()pr/properties.c
  PR_to_string()pr/properties.c
  QC_environ_to_string()qc/query_command.c
  QC_fill()qc/query_command.c
  QC_query_command_to_string()qc/query_command.c
  QI_fast_output()qi/query_instructions.c
  SK_getpeername()sk/sk_socket.c
  SQ_get_column_label()sq/mysql_driver.c
  SQ_get_column_strings()sq/mysql_driver.c
  SQ_info_to_string()sq/mysql_driver.c
  SQ_result_to_string()sq/mysql_driver.c
  TH_to_string()th/thread.c
  VerifySignAndExplodeFile()pa/gpg.c
  add_property()pr/properties.c
  authenticate_user()pc/protocol_config.c
  ca_UpdSrcHandle2StrElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c
  create_query()qi/query_instructions.c
  er_add_exec_arg()er/er_paths.c
  er_yylex()er/lex.er_yy.c
  filter()qi/query_instructions.c
  make_sql2pack()rp/rp_load.c
  qc_sources_list_to_string()qc/query_command.c
  show_string()co/constants.c
  wr_real_string()ut/memwrap.c

Global Function wr_log_set()

void wr_log_set ( int value )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_memory_log()ut/memwrap.c

Global Function wr_real_calloc()

er_ret_t wr_real_calloc ( void** ptr, size_t num, size_t size, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_calloc_real()ut/memwrap.c

Global Function wr_real_clear_list()

void wr_real_clear_list ( GList** list, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: g_list_foreach(), g_list_free()
Called by: AC_asc_acl_command_set()ac/access_control.c
  AC_asc_ban_set()ac/access_control.c
  AC_findcreate_account_l()ac/access_control.c
  AC_findcreate_acl_l()ac/access_control.c
  IP_smart_range()ip/ip.c
  RP_asc_search()rp/rp_search.c
  RX_bin_search()rx/rx_search.c
  RX_in_node()rx/rx_node.c
  ac_find_acl_l()ac/access_control.c
  er_delete_path()er/er_paths.c
  insert_radix_serials()qi/query_instructions.c
  mnt_irt_filter()qi/query_instructions.c
  rp_exclude_datlink()rp/rp_search.c
  rx_bin_node()rx/rx_node.c
  ta_remove_l()ta/ta.c
  write_radix_immediate()qi/query_instructions.c
References Functions: wr_free_list_element()ut/memwrap.c

Global Function wr_real_free()

er_ret_t wr_real_free ( void* ptr, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_free_real()ut/memwrap.c
Called by: wr_free_list_element()ut/memwrap.c

Global Function wr_real_malloc()

er_ret_t wr_real_malloc ( void** ptr, size_t size, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_malloc_real()ut/memwrap.c

Global Function wr_real_realloc()

er_ret_t wr_real_realloc ( void** ptr, size_t size, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_realloc_real()ut/memwrap.c

Global Function wr_real_string()

char* wr_real_string ( const char* text, const char* file, int line )
Prototyped in: /home/shane/release/RIP/include/memwrap.h
Calls: UT_strdup_real()ut/memwrap.c
Called by: SK_getpeername()sk/sk_socket.c
  command_execute()pc/protocol_config.c
  create_asblock_query()qi/query_instructions.c
  find_command()pc/protocol_config.c

Local Function UT_alloc_log()

static void UT_alloc_log ( const void* ptr, int len, const char* file, int line )
Calls: ER_dbg_va()er/er.c
Called by: UT_calloc_real()ut/memwrap.c
  UT_malloc_real()ut/memwrap.c
  UT_realloc_real()ut/memwrap.c
References Variables: UT_memory_loggingut/memwrap.c

Local Function UT_free_log()

static void UT_free_log ( const void* ptr, const char* file, int line )
Calls: ER_dbg_va()er/er.c
Called by: UT_free_real()ut/memwrap.c
  UT_realloc_real()ut/memwrap.c
References Variables: UT_memory_loggingut/memwrap.c

Local Function asctime_r()

static char* asctime_r ( const struct tm* __tm, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_asctime_r()

Local Function ctime_r()

static char* ctime_r ( const time_t* __time, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_ctime_r()

Local Function getlogin_r()

static int getlogin_r ( char* __name, int __len )
Included from: /usr/include/unistd.h
Calls: __posix_getlogin_r()

Local Function readdir_r()

static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
Included from: /usr/include/dirent.h
Calls: __posix_readdir_r()

Local Function sigwait()

static int sigwait ( const sigset_t* __setp, int* __signo )
Included from: /usr/include/signal.h
Calls: __posix_sigwait()

Local Function ttyname_r()

static int ttyname_r ( int __fildes, char* __buf, size_t __size )
Included from: /usr/include/unistd.h
Calls: __posix_ttyname_r()

Local Function wr_free_list_element()

static void wr_free_list_element ( void* cpy, void* trash )
Calls: wr_real_free()ut/memwrap.c
Used in: wr_real_clear_list()ut/memwrap.c