Asterisk - The Open Source Telephony Project
21.4.1
|
Asterisk memory management routines. More...
Go to the source code of this file.
Macros | |
#define | _ASTERISK_ASTMM_H |
#define | asprintf(a, b, c...) Do_not_use_asprintf__use_ast_asprintf->fail(a, b, c) |
#define | ast_alloca(size) __builtin_alloca(size) |
call __builtin_alloca to ensure we get gcc builtin semantics More... | |
#define | ast_asprintf(ret, fmt, ...) __ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, (ret), (fmt), __VA_ARGS__) |
A wrapper for asprintf() More... | |
#define | ast_calloc(num, len) __ast_calloc((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for calloc() More... | |
#define | ast_calloc_cache(num, len) __ast_calloc_cache((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for calloc() for use in cache pools. More... | |
#define | ast_free(a) __ast_free(a, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ast_malloc(len) __ast_malloc((len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for malloc() More... | |
#define | ast_realloc(p, len) __ast_realloc((p), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for realloc() More... | |
#define | ast_strdup(str) __ast_strdup((str), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for strdup() More... | |
#define | ast_strdupa(s) |
duplicate a string in memory from the stack More... | |
#define | ast_strndup(str, len) __ast_strndup((str), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for strndup() More... | |
#define | ast_vasprintf(ret, fmt, ap) __ast_vasprintf((ret), (fmt), (ap), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for vasprintf() More... | |
#define | ASTMM_LIBC ASTMM_BLOCK |
#define | calloc(a, b) Do_not_use_calloc__use_ast_calloc->fail(a, b) |
#define | free(a) Do_not_use_free__use_ast_free_or_ast_std_free_for_remotely_allocated_memory->fail(a) |
#define | malloc(a) Do_not_use_malloc__use_ast_malloc->fail(a) |
#define | realloc(a, b) Do_not_use_realloc__use_ast_realloc->fail(a, b) |
#define | strdup(a) Do_not_use_strdup__use_ast_strdup->fail(a) |
#define | strndup(a, b) Do_not_use_strndup__use_ast_strndup->fail(a, b) |
#define | vasprintf(a, b, c) Do_not_use_vasprintf__use_ast_vasprintf->fail(a, b, c) |
#define | ASTMM_BLOCK 0 |
ASTMM_LIBC can be defined to control the meaning of standard allocators. More... | |
#define | ASTMM_REDIRECT 1 |
Redirect standard allocators to use Asterisk functions. More... | |
#define | ASTMM_IGNORE 2 |
Standard allocators are used directly. More... | |
Functions | |
int | __ast_asprintf (const char *file, int lineno, const char *func, char **strp, const char *format,...) |
void * | __ast_calloc (size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc |
void * | __ast_calloc_cache (size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc |
void | __ast_free (void *ptr, const char *file, int lineno, const char *func) |
void * | __ast_malloc (size_t size, const char *file, int lineno, const char *func) attribute_malloc |
void * | __ast_realloc (void *ptr, size_t size, const char *file, int lineno, const char *func) |
int | __ast_repl_asprintf (const char *file, int lineno, const char *func, char **strp, const char *format,...) |
void * | __ast_repl_calloc (size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc |
void * | __ast_repl_malloc (size_t size, const char *file, int lineno, const char *func) attribute_malloc |
void * | __ast_repl_realloc (void *ptr, size_t size, const char *file, int lineno, const char *func) |
char * | __ast_repl_strdup (const char *s, const char *file, int lineno, const char *func) attribute_malloc |
char * | __ast_repl_strndup (const char *s, size_t n, const char *file, int lineno, const char *func) attribute_malloc |
int | __ast_repl_vasprintf (char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func) |
char * | __ast_strdup (const char *s, const char *file, int lineno, const char *func) attribute_malloc |
char * | __ast_strndup (const char *s, size_t n, const char *file, int lineno, const char *func) attribute_malloc |
int | __ast_vasprintf (char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func) |
void | ast_free_ptr (void *ptr) |
free() wrapper More... | |
void * | ast_std_calloc (size_t nmemb, size_t size) attribute_malloc |
void | ast_std_free (void *ptr) |
void * | ast_std_malloc (size_t size) attribute_malloc |
void * | ast_std_realloc (void *ptr, size_t size) |
Asterisk memory management routines.
This file should never be #included directly, it is included by asterisk.h.
Definition in file astmm.h.
#define ast_alloca | ( | size | ) | __builtin_alloca(size) |
call __builtin_alloca to ensure we get gcc builtin semantics
size | The size of the buffer we want allocated |
This macro will attempt to allocate memory from the stack. If it fails you won't get a NULL returned, but a SEGFAULT if you're lucky.
Definition at line 288 of file astmm.h.
Referenced by __analog_handle_event(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_channel_publish_varset(), ast_dsp_process(), ast_event_append_ie_str(), ast_fileexists(), ast_media_index_update_for_file(), ast_mkdir(), ast_openstream_full(), ast_openvstream(), ast_pjproject_get_buildopt(), ast_sorcery_object_fields_register(), ast_unreal_new_channels(), ast_waitfor_nandfds(), ast_websocket_write(), bridge_merge(), bucket_file_wizard_retrieve(), bucket_wizard_retrieve(), callerid_feed(), callerid_feed_jp(), chan_pjsip_incoming_response_update_cause(), curl_header_cb(), dns_naptr_sort(), does_category_match(), find_by_channel(), find_user(), is_video_dest(), jingle_action_session_terminate(), lua_get_variable(), lua_get_variable_value(), lua_read_extensions_file(), sms_generate(), stasis_state_manager_create(), stasis_topic_pool_create(), and vm_delete().
#define ast_asprintf | ( | ret, | |
fmt, | |||
... | |||
) | __ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, (ret), (fmt), __VA_ARGS__) |
A wrapper for asprintf()
ast_asprintf() is a wrapper for asprintf() that will generate an Asterisk log message in the case that the allocation fails.
The arguments and return value are the same as asprintf()
Definition at line 267 of file astmm.h.
Referenced by app_create(), append_vmu_info_astman(), ari_bridges_play_helper(), ast_ari_bridges_record(), ast_ari_channels_record(), ast_endpoint_latest_snapshot(), ast_file_fdtemp(), astman_append_headers(), build_filename(), dial_exec_full(), internal_stasis_subscribe(), process_media_file(), restrictedFile(), split_path(), stasis_app_control_record(), stasis_caching_topic_create(), stasis_cp_all_create(), stasis_topic_pool_get_topic(), and timeval_struct2str().
#define ast_calloc | ( | num, | |
len | |||
) | __ast_calloc((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for calloc()
ast_calloc() is a wrapper for calloc() that will generate an Asterisk log message in the case that the allocation fails.
The arguments and return value are the same as calloc()
Definition at line 202 of file astmm.h.
Referenced by __ast_format_def_register(), __ast_pbx_run(), aco_info_init(), add_ids(), add_redirect(), alloc_profile(), answer_exec_enable(), ao2_weakproxy_subscribe(), ast_add_extension2(), ast_add_extension2_lockopt(), ast_add_hint(), ast_add_profile(), ast_aoc_create(), ast_aoc_decode(), ast_aoc_encode(), ast_app_group_set_channel(), ast_append_acl(), ast_ari_bridges_record(), ast_ari_channels_create(), ast_audiohook_attach(), ast_autochan_setup(), ast_autoservice_start(), ast_base64encode_string(), ast_bridge_channel_establish_roles(), ast_bridge_set_after_callback(), ast_category_inherit(), ast_category_new(), ast_cc_agent_register(), ast_cc_agent_status_response(), ast_cc_build_frame(), ast_cc_extension_monitor_add_dialstring(), ast_cc_monitor_failed(), ast_cc_monitor_register(), ast_cdr_alloc(), ast_channel_iterator_all_new(), ast_channel_iterator_by_exten_new(), ast_channel_iterator_by_name_new(), ast_channel_register(), ast_channel_start_silence_generator(), ast_cli_completion_vector(), ast_cli_perms_init(), ast_config_new(), ast_context_find_or_create(), ast_data_buffer_alloc(), ast_devstate_changed_literal(), ast_devstate_prov_add(), ast_dial_append(), ast_dial_append_channel(), ast_dial_create(), ast_dns_resolver_set_result(), ast_dnsmgr_get_family(), ast_duplicate_acl_list(), ast_event_new(), ast_fax_tech_register(), ast_framehook_attach(), ast_get_enum(), ast_iax2_new(), ast_jb_create_framehook(), ast_linear_stream(), ast_merge_contexts_and_delete(), ast_msg_data_alloc(), ast_msg_var_iterator_init(), ast_multicast_rtp_create_options(), ast_odbc_find_table(), ast_presence_state_prov_add(), ast_refer_var_iterator_init(), ast_register_application2(), ast_rtcp_interpret(), ast_rtp_new(), ast_rtp_prop_set(), ast_safe_fork(), ast_sched_context_create(), ast_sched_start_thread(), ast_sdp_srtp_alloc(), ast_setlocale(), ast_setup_cc_recall_datastore(), ast_sorcery_object_fields_register(), ast_speech_new(), ast_srv_lookup(), ast_ssl_init(), ast_stream_alloc(), ast_stream_clone(), ast_tcptls_server_start(), ast_threadstorage_get(), ast_timer_open(), audiohook_volume_get(), audiosocket_request(), authenticate_reply(), build_conf(), callerid_new(), cdr_object_create_public_records(), chan_pjsip_incoming_request(), conf_add_post_join_action(), config_ldap(), copy_rules(), create_followme_number(), create_vmaccount(), data_buffer_payload_alloc(), defer_full_frame(), dial_exec_full(), display_single_entry(), dns_naptr_alloc(), dns_srv_alloc(), dns_txt_alloc(), expression_token_alloc(), fax_session_new(), find_user(), find_user_realtime(), get_park_common_datastore_copy(), include_alloc(), init_convolve_channel(), init_convolve_data(), insert_penaltychange(), io_context_create(), jb_new(), load_realtime_rules(), make_silence(), mbl_load_adapter(), mbl_load_device(), message_template_parse_filebody(), mkintf(), msg_queue_push(), msg_queue_push_data(), multicast_rtp_new(), newpvt(), optional_api_create(), optional_api_user_create(), pri_queue_for_destruction(), queue_signalling(), realtime_ldap_result_to_vars(), receive_ademco_event(), receivefax_exec(), reload_queue_rules(), rtp_ioqueue_thread_get_or_create(), rtp_red_init(), rtp_reload(), sendfax_exec(), session_refresh_state_get_or_alloc(), set_config(), sig_pri_cc_agent_init(), softmix_bridge_create(), softmix_bridge_join(), sorcery_object_type_alloc(), spandsp_fax_new(), speech_background(), stasis_app_control_continue(), stasis_app_control_dtmf(), stasis_app_control_move(), stasis_app_control_mute(), stasis_app_control_set_channel_var(), stasis_app_control_snoop(), stasis_app_control_unmute(), substituted(), t38_state_get_or_alloc(), table_config_new(), tdd_feed(), tdd_new(), test_core_format_clone(), test_listener_pvt_alloc(), timezone_add(), try_load_key(), and xmpp_pak_message().
#define ast_calloc_cache | ( | num, | |
len | |||
) | __ast_calloc_cache((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for calloc() for use in cache pools.
ast_calloc_cache() is a wrapper for calloc() that will generate an Asterisk log message in the case that the allocation fails. When memory debugging is in use, the memory allocated by this function will be marked as 'cache' so it can be distinguished from normal memory allocations.
The arguments and return value are the same as calloc()
#define ast_malloc | ( | len | ) | __ast_malloc((len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for malloc()
ast_malloc() is a wrapper for malloc() that will generate an Asterisk log message in the case that the allocation fails.
The argument and return value are the same as malloc()
Definition at line 191 of file astmm.h.
Referenced by __ast_frisolate(), action_command(), append_event(), ast_app_run_sub(), ast_ari_applications_subscribe_cb(), ast_ari_applications_subscribe_parse_body(), ast_ari_applications_unsubscribe_cb(), ast_ari_applications_unsubscribe_parse_body(), ast_ari_asterisk_get_info_cb(), ast_ari_asterisk_get_info_parse_body(), ast_ari_bridges_add_channel_cb(), ast_ari_bridges_add_channel_parse_body(), ast_ari_bridges_play_cb(), ast_ari_bridges_play_parse_body(), ast_ari_bridges_play_with_id_cb(), ast_ari_bridges_play_with_id_parse_body(), ast_ari_bridges_record(), ast_ari_bridges_remove_channel_cb(), ast_ari_bridges_remove_channel_parse_body(), ast_ari_channels_play_cb(), ast_ari_channels_play_parse_body(), ast_ari_channels_play_with_id_cb(), ast_ari_channels_play_with_id_parse_body(), ast_ari_channels_record(), ast_ari_events_user_event_cb(), ast_ari_events_user_event_parse_body(), ast_audiosocket_receive_frame(), ast_base64decode_string(), ast_base64url_decode_string(), ast_base64url_encode_string(), ast_bridge_features_new(), ast_cel_fabricate_channel_from_event(), ast_connected_line_parse_data(), ast_dns_txt_get_strings(), ast_event_new(), ast_http_get_contents(), ast_io_add(), ast_iostream_printf(), ast_json_malloc(), ast_loader_register(), ast_msg_data_dup(), ast_pbx_hangup_handler_push(), ast_read_textfile(), ast_redirecting_parse_data(), ast_rtp_read(), ast_say_number_full_ka(), ast_set_default_eid(), ast_sockaddr_resolve(), ast_str_to_uuid(), ast_utf8_validator_new(), ast_uuid_copy(), ast_uuid_generate(), ast_writefile(), confbridge_exec(), filter_history(), generate_filenames_string(), hep_queue_cb(), hepv3_create_capture_info(), init_batch(), init_convolve_data(), io_context_create(), load_module(), lua_read_extensions_file(), queue_read_action_payload(), queue_signalling(), rtp_raw_write(), set_binaural_data_join(), set_timeout(), stasis_app_control_play_uri(), stasis_message_sink_create(), vm_change_password(), and wizard_mapped_observer().
#define ast_realloc | ( | p, | |
len | |||
) | __ast_realloc((p), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for realloc()
ast_realloc() is a wrapper for realloc() that will generate an Asterisk log message in the case that the allocation fails.
The arguments and return value are the same as realloc()
Definition at line 226 of file astmm.h.
Referenced by ast_add_profile(), ast_event_append_ie_raw(), ast_http_get_contents(), ast_playtones_start(), enum_callback(), io_grow(), message_sink_cb(), set_binaural_data_join(), and store_tone_zone_ring_cadence().
#define ast_strdup | ( | str | ) | __ast_strdup((str), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for strdup()
ast_strdup() is a wrapper for strdup() that will generate an Asterisk log message in the case that the allocation fails.
ast_strdup(), unlike strdup(), can safely accept a NULL argument. If a NULL argument is provided, ast_strdup will return NULL without generating any kind of error log message.
The argument and return value are the same as strdup()
Definition at line 241 of file astmm.h.
Referenced by __analog_handle_event(), __ast_channel_alloc_ap(), __ast_datastore_alloc(), __ast_frisolate(), __ast_sorcery_apply_config(), add_hintdevice(), answer_exec_enable(), app_create(), app_set_replace_channel_app(), apply_option(), apply_options_full(), ast_add_profile(), ast_ari_applications_subscribe_cb(), ast_ari_applications_unsubscribe_cb(), ast_ari_asterisk_get_info_cb(), ast_ari_bridges_add_channel_cb(), ast_ari_bridges_play_cb(), ast_ari_bridges_play_with_id_cb(), ast_ari_bridges_remove_channel_cb(), ast_ari_channels_play_cb(), ast_ari_channels_play_with_id_cb(), ast_ari_events_user_event_cb(), ast_bridge_timelimit(), ast_build_timing(), ast_cc_monitor_failed(), ast_cel_fabricate_channel_from_event(), ast_check_command_in_path(), ast_cli_complete(), ast_cli_perms_init(), ast_complete_applications(), ast_complete_channels(), ast_config_hook_register(), ast_crypt(), ast_datastores_alloc_datastore(), ast_ext_ctx(), ast_hint_presence_state(), ast_hook_send_action(), ast_iax2_new(), ast_iostream_set_sni_hostname(), ast_merge_contexts_and_delete(), ast_module_helper(), ast_odbc_execute_sql(), ast_odbc_prepare(), ast_party_dialed_copy(), ast_party_dialed_set(), ast_party_id_copy(), ast_party_id_set(), ast_party_name_copy(), ast_party_name_set(), ast_party_number_copy(), ast_party_number_set(), ast_party_redirecting_reason_copy(), ast_party_redirecting_reason_set(), ast_party_subaddress_copy(), ast_party_subaddress_set(), ast_readfile(), ast_refer_get_var_and_unlink(), ast_register_indication(), ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_parse(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_rtp_prop_set(), ast_rtp_remote_address_set(), ast_safe_mkdir(), ast_sendtext_data(), ast_set_callerid(), ast_sip_security_mechanisms_to_str(), ast_sip_str_to_security_mechanism(), ast_sorcery_alloc(), ast_streamfile(), ast_tcptls_server_start(), ast_tls_read_conf(), ast_to_camel_case_delim(), ast_variable_lists_match(), ast_vector_string_split(), ast_writefile(), authenticate_api_key(), build_calendar(), chan_pjsip_new(), cli_complete_show(), complete_core_show_hint(), complete_dialplan_add_extension(), complete_mohclass_realtime(), complete_queue(), coreshowchannelmap_add_to_map(), curl_download_to_file(), dial_exec_full(), do_forward(), do_say(), enum_callback(), fax_session_new(), fax_session_tab_complete(), find_user(), generate_filenames_string(), get_park_common_datastore_copy(), graceful_unload_possible(), handle_call_forward(), handle_cli_dialplan_add_extension(), handle_cli_sound_show(), handle_show_named_acl_cmd(), handle_updates(), is_prefix(), main(), message_template_parse_emailbody(), parse_config(), pbx_load_users(), pbx_set_overrideswitch(), process_description_file(), realtime_ldap_result_to_vars(), realtime_multi_curl(), register_verify(), request_withdraw_caller_from_queue(), ring_entry(), save_dialstring(), set_full_cmd(), sig_pri_call(), speech_background(), speech_processing_sound(), split_ec(), split_path(), stasis_app_bridge_playback_channel_add(), stasis_app_control_add_role(), stasis_app_control_moh_start(), stasis_app_control_redirect(), stasis_app_control_set_channel_var(), stasis_message_type_create(), table_config_new(), test_cel_peer_strings_match(), transport_state_callback(), unistim_new(), user_alloc(), wait_for_answer(), xmpp_pak_message(), and xmpp_pak_presence().
#define ast_strdupa | ( | s | ) |
duplicate a string in memory from the stack
s | The string to duplicate |
This macro will duplicate the given string. It returns a pointer to the stack allocated memory for the new string.
Definition at line 298 of file astmm.h.
Referenced by __ast_channel_alloc_ap(), __ast_play_and_record(), _ast_device_state(), acf_odbc_write(), aco_process_var(), action_bridge(), action_status(), add_redirect(), admin_exec(), advanced_options(), agent_login_exec(), agent_request_exec(), answer_exec_enable(), app_exec(), append_var_and_value_to_filter(), apply_options(), aqm_exec(), ast_app_getdata_terminator(), ast_append_acl(), ast_ari_channels_create(), ast_ari_channels_dial(), ast_ari_channels_external_media(), ast_ari_channels_redirect(), ast_ari_endpoints_refer_to_endpoint(), ast_ari_endpoints_send_message_to_endpoint(), ast_bridge_channel_playfile(), ast_bridge_set_after_go_on(), ast_bridge_setup_after_goto(), ast_bridge_timelimit(), ast_bridge_transfer_attended(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_build_timing(), ast_cdr_setvar(), ast_channel_connected_line_sub(), ast_channel_redirecting_sub(), ast_channel_yank(), ast_config_hook_unregister(), ast_control_tone(), ast_dial_append_channel(), ast_do_pickup(), ast_format_cap_update_by_allow_disallow(), ast_format_str_reduce(), ast_func_read(), ast_func_read2(), ast_func_write(), ast_get_namedgroups(), ast_iax2_new(), ast_media_cache_create_or_update(), ast_mkdir(), ast_msg_send(), ast_multi_channel_blob_get_channels(), ast_ouraddrfor(), ast_parse_arg(), ast_pickup_call(), ast_playtones_start(), ast_refer_send(), ast_rtp_engine_load_format(), ast_sip_security_mechanism_vector_init(), ast_sip_str_to_security_mechanism(), ast_sockaddr_parse(), ast_sockaddr_pj_sockaddr_cmp(), ast_sockaddr_resolve(), ast_str_retrieve_variable(), ast_stream_codec_prefs_parse(), ast_strings_match(), ast_utils_which(), ast_variable_list_from_quoted_string(), ast_variables_match(), ast_vector_string_split(), astman_send_error_va(), attended_transfer_bridge(), attended_transfer_properties_alloc(), audiosocket_request(), authenticate_reply(), bridge_agent_hold_push(), bridge_exec(), bucket_file_wizard_retrieve(), bucket_wizard_retrieve(), build_expression_queue(), build_user(), callerid_read(), channel_admin_exec(), channel_do_masquerade(), check_dow(), comeback_goto(), conf_exec(), confbridge_exec(), confbridge_handle_atxfer(), count_exec(), create_followme_number(), create_queue_member(), create_sound_blob(), curl_download_to_memory(), curler(), dial_exec_full(), do_say(), does_category_match(), feature_blind_transfer(), fileexists_core(), find_user(), forward_message(), grab_transfer(), handle_call_forward(), handle_cli_check_permissions(), handle_cli_dialplan_add_extension(), handle_cli_file_convert(), handle_cli_iax2_show_peer(), handle_debug_dialplan(), handle_eval_function(), handle_options(), hangupcause_read(), iax2_devicestate(), iax2_prov_app(), init_logger_chain(), insert_penaltychange(), is_prefix(), is_valid_dtmf(), jingle_request(), leave_voicemail(), local_alloc(), local_call(), local_devicestate(), lua_get_variable_value(), lua_pbx_exec(), lua_set_variable_value(), make_email_file(), minivm_accmess_exec(), minivm_account_func_read(), minivm_counter_func_read(), minivm_counter_func_write(), monitor_dial(), multicast_rtp_request(), mute_mixmonitor_instance(), notify_new_message(), orig_app(), orig_exten(), pbx_builtin_pushvar_helper(), pbx_builtin_setvar(), pbx_builtin_setvar_helper(), pbx_builtin_setvar_multiple(), pbx_extension_helper(), pbx_retrieve_variable(), peer_set_srcaddr(), pjsip_acf_channel_read(), pjsip_acf_dial_contacts_read(), pjsip_acf_parse_uri_read(), pqm_exec(), pvt_cause_cmp_fn(), pvt_cause_hash_fn(), ql_exec(), queue_exec(), queue_function_queuegetchannel(), queue_set_param(), qupd_exec(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_peer(), realtime_user(), receivefax_exec(), register_verify(), reload_single_member(), report_receive_fax_status(), report_send_fax_status(), restrictedFile(), rqm_exec(), rtp_add_candidates_to_ice(), rtp_reload(), sendfax_exec(), set_config(), setup_privacy_args(), sig_pri_extract_called_num_subaddr(), sla_queue_event_conf(), sla_ring_station(), speech_background(), speech_load(), stun_monitor_request(), timezone_add(), unicast_rtp_request(), update_registry(), upqm_exec(), wait_for_answer(), waitstream_core(), xmpp_client_authenticate_sasl(), xmpp_join_exec(), xmpp_leave_exec(), and xmpp_sendgroup_exec().
#define ast_strndup | ( | str, | |
len | |||
) | __ast_strndup((str), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for strndup()
ast_strndup() is a wrapper for strndup() that will generate an Asterisk log message in the case that the allocation fails.
ast_strndup(), unlike strndup(), can safely accept a NULL argument for the string to duplicate. If a NULL argument is provided, ast_strdup will return NULL without generating any kind of error log message.
The arguments and return value are the same as strndup()
Definition at line 256 of file astmm.h.
Referenced by ast_cli_completion_vector(), ast_recvtext(), ast_rtp_ice_add_cand(), get_content_type(), and get_media_encryption_type().
#define ast_vasprintf | ( | ret, | |
fmt, | |||
ap | |||
) | __ast_vasprintf((ret), (fmt), (ap), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
A wrapper for vasprintf()
ast_vasprintf() is a wrapper for vasprintf() that will generate an Asterisk log message in the case that the allocation fails.
The arguments and return value are the same as vasprintf()
Definition at line 278 of file astmm.h.
Referenced by ast_cc_monitor_failed(), ast_json_vstringf(), and ast_udptl_set_tag().
#define ASTMM_BLOCK 0 |
ASTMM_LIBC can be defined to control the meaning of standard allocators.
Produce compiler errors if standard allocators are used.
#define ASTMM_IGNORE 2 |
Standard allocators are used directly.
#define ASTMM_REDIRECT 1 |
Redirect standard allocators to use Asterisk functions.
void ast_free_ptr | ( | void * | ptr | ) |
free() wrapper
ast_free_ptr should be used when a function pointer for free() needs to be passed as the argument to a function. Otherwise, astmm will cause seg faults.
Definition at line 1739 of file main/astmm.c.
Referenced by app_create(), ast_hint_presence_state(), ast_merge_contexts_and_delete(), ast_rtp_prop_set(), ast_rtp_read(), confbridge_exec(), control_move_cleanup(), handle_cli_dialplan_add_extension(), pbx_load_users(), pjsip_acf_dial_contacts_read(), stasis_app_control_add_role(), stasis_app_control_continue(), stasis_app_control_dtmf(), stasis_app_control_moh_start(), stasis_app_control_move(), stasis_app_control_mute(), stasis_app_control_redirect(), and stasis_app_control_unmute().