#include "asterisk.h"
#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
#include "asterisk/paths.h"
#include <execinfo.h>
Go to the source code of this file.
Data Structures | |
struct | __priv_data |
struct | ao2_container |
struct | astobj2 |
struct | bucket |
struct | bucket_entry |
Macros | |
#define | AO2_MAGIC 0xa570b123 |
#define | EXTERNAL_OBJ(_p) ((_p) == NULL ? NULL : (_p)->user_data) |
convert from a pointer _p to an astobj2 object More... | |
#define | N1 20 |
Enumerations | |
enum | ao2_callback_type { DEFAULT, WITH_DATA } |
Functions | |
void * | __ao2_alloc (size_t data_size, ao2_destructor_fn destructor_fn) |
void * | __ao2_alloc_debug (size_t data_size, ao2_destructor_fn destructor_fn, char *tag, const char *file, int line, const char *funcname, int ref_debug) |
void * | __ao2_callback (struct ao2_container *c, const enum search_flags flags, ao2_callback_fn *cb_fn, void *arg) |
void * | __ao2_callback_data (struct ao2_container *c, const enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data) |
void * | __ao2_callback_data_debug (struct ao2_container *c, const enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data, char *tag, char *file, int line, const char *funcname) |
void * | __ao2_callback_debug (struct ao2_container *c, const enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, char *tag, char *file, int line, const char *funcname) |
struct ao2_container * | __ao2_container_alloc (const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn) |
struct ao2_container * | __ao2_container_alloc_debug (const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn, char *tag, char *file, int line, const char *funcname, int ref_debug) |
void * | __ao2_find (struct ao2_container *c, void *arg, enum search_flags flags) |
void * | __ao2_find_debug (struct ao2_container *c, void *arg, enum search_flags flags, char *tag, char *file, int line, const char *funcname) |
void * | __ao2_iterator_next (struct ao2_iterator *a) |
void * | __ao2_iterator_next_debug (struct ao2_iterator *a, char *tag, char *file, int line, const char *funcname) |
void * | __ao2_link (struct ao2_container *c, void *user_data) |
void * | __ao2_link_debug (struct ao2_container *c, void *user_data, char *tag, char *file, int line, const char *funcname) |
int | __ao2_lock (void *user_data, const char *file, const char *func, int line, const char *var) |
Lock an object. More... | |
int | __ao2_ref (void *user_data, const int delta) |
int | __ao2_ref_debug (void *user_data, const int delta, const char *tag, const char *file, int line, const char *funcname) |
int | __ao2_trylock (void *user_data, const char *file, const char *func, int line, const char *var) |
Try locking– (don't block if fail) More... | |
void * | __ao2_unlink (struct ao2_container *c, void *user_data) |
void * | __ao2_unlink_debug (struct ao2_container *c, void *user_data, char *tag, char *file, int line, const char *funcname) |
int | __ao2_unlock (void *user_data, const char *file, const char *func, int line, const char *var) |
Unlock an object. More... | |
void | ao2_bt (void) |
int | ao2_container_count (struct ao2_container *c) |
Returns the number of elements in a container. More... | |
void | ao2_iterator_destroy (struct ao2_iterator *i) |
Destroy a container iterator. More... | |
struct ao2_iterator | ao2_iterator_init (struct ao2_container *c, int flags) |
Create an iterator for a container. More... | |
int | ao2_match_by_addr (void *user_data, void *arg, int flags) |
another convenience function is a callback that matches on address More... | |
void * | ao2_object_get_lockaddr (void *obj) |
Return the lock address of an object. More... | |
static void | astobj2_cleanup (void) |
int | astobj2_init (void) |
static int | cb_true (void *user_data, void *arg, int flags) |
special callback that matches all More... | |
static int | cb_true_data (void *user_data, void *arg, void *data, int flags) |
similar to cb_true, but is an ao2_callback_data_fn instead More... | |
static int | cd_cb (void *obj, void *arg, int flag) |
static int | cd_cb_debug (void *obj, void *arg, int flag) |
static void | container_destruct (void *c) |
static void | container_destruct_debug (void *c) |
static int | hash_zero (const void *user_obj, const int flags) |
always zero hash function More... | |
static void * | internal_ao2_alloc (size_t data_size, ao2_destructor_fn destructor_fn, const char *file, int line, const char *funcname) |
static void * | internal_ao2_callback (struct ao2_container *c, const enum search_flags flags, void *cb_fn, void *arg, void *data, enum ao2_callback_type type, char *tag, char *file, int line, const char *funcname) |
static struct ao2_container * | internal_ao2_container_alloc (struct ao2_container *c, const uint n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn) |
static struct ao2_container * | internal_ao2_container_alloc (struct ao2_container *c, const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn) |
static void * | internal_ao2_iterator_next (struct ao2_iterator *a, struct bucket_entry **q) |
static struct bucket_entry * | internal_ao2_link (struct ao2_container *c, void *user_data, const char *file, int line, const char *func) |
static int | internal_ao2_ref (void *user_data, const int delta) |
static struct astobj2 * | INTERNAL_OBJ (void *user_data) |
convert from a pointer _p to a user-defined object More... | |
Variables | |
static FILE * | ref_log |
#define AO2_MAGIC 0xa570b123 |
Definition at line 58 of file astobj2.c.
Referenced by internal_ao2_alloc(), and INTERNAL_OBJ().
#define EXTERNAL_OBJ | ( | _p | ) | ((_p) == NULL ? NULL : (_p)->user_data) |
convert from a pointer _p to an astobj2 object
Definition at line 148 of file astobj2.c.
Referenced by internal_ao2_alloc(), internal_ao2_callback(), and internal_ao2_iterator_next().
#define N1 20 |
Referenced by ao2_bt().
enum ao2_callback_type |
Enumerator | |
---|---|
DEFAULT | |
WITH_DATA |
Definition at line 138 of file astobj2.c.
void* __ao2_alloc | ( | size_t | data_size, |
ao2_destructor_fn | destructor_fn | ||
) |
Definition at line 354 of file astobj2.c.
References internal_ao2_alloc().
Referenced by __ao2_container_alloc().
void* __ao2_alloc_debug | ( | size_t | data_size, |
ao2_destructor_fn | destructor_fn, | ||
char * | tag, | ||
const char * | file, | ||
int | line, | ||
const char * | funcname, | ||
int | ref_debug | ||
) |
Definition at line 335 of file astobj2.c.
References ast_get_tid(), and internal_ao2_alloc().
Referenced by __ao2_container_alloc_debug(), __ast_channel_alloc_ap(), _moh_class_malloc(), and ast_dummy_channel_alloc().
void* __ao2_callback | ( | struct ao2_container * | c, |
const enum search_flags | flags, | ||
ao2_callback_fn * | cb_fn, | ||
void * | arg | ||
) |
Definition at line 782 of file astobj2.c.
References DEFAULT, and internal_ao2_callback().
Referenced by __ao2_find(), __ao2_unlink(), and container_destruct().
void* __ao2_callback_data | ( | struct ao2_container * | c, |
const enum search_flags | flags, | ||
ao2_callback_data_fn * | cb_fn, | ||
void * | arg, | ||
void * | data | ||
) |
Definition at line 796 of file astobj2.c.
References internal_ao2_callback(), and WITH_DATA.
void* __ao2_callback_data_debug | ( | struct ao2_container * | c, |
const enum search_flags | flags, | ||
ao2_callback_data_fn * | cb_fn, | ||
void * | arg, | ||
void * | data, | ||
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
Definition at line 788 of file astobj2.c.
References internal_ao2_callback(), and WITH_DATA.
void* __ao2_callback_debug | ( | struct ao2_container * | c, |
const enum search_flags | flags, | ||
ao2_callback_fn * | cb_fn, | ||
void * | arg, | ||
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
Definition at line 774 of file astobj2.c.
References DEFAULT, and internal_ao2_callback().
Referenced by __ao2_find_debug(), __ao2_unlink_debug(), and container_destruct_debug().
struct ao2_container* __ao2_container_alloc | ( | const unsigned int | n_buckets, |
ao2_hash_fn * | hash_fn, | ||
ao2_callback_fn * | cmp_fn | ||
) |
Definition at line 454 of file astobj2.c.
References __ao2_alloc(), container_destruct(), and internal_ao2_container_alloc().
struct ao2_container* __ao2_container_alloc_debug | ( | const unsigned int | n_buckets, |
ao2_hash_fn * | hash_fn, | ||
ao2_callback_fn * | cmp_fn, | ||
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname, | ||
int | ref_debug | ||
) |
Definition at line 441 of file astobj2.c.
References __ao2_alloc_debug(), container_destruct(), container_destruct_debug(), and internal_ao2_container_alloc().
void* __ao2_find | ( | struct ao2_container * | c, |
void * | arg, | ||
enum search_flags | flags | ||
) |
Definition at line 810 of file astobj2.c.
References __ao2_callback(), and ao2_container::cmp_fn.
Referenced by _get_mohbyname().
void* __ao2_find_debug | ( | struct ao2_container * | c, |
void * | arg, | ||
enum search_flags | flags, | ||
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
the find function just invokes the default callback with some reasonable flags.
Definition at line 805 of file astobj2.c.
References __ao2_callback_debug(), and ao2_container::cmp_fn.
Referenced by _get_mohbyname().
void* __ao2_iterator_next | ( | struct ao2_iterator * | a | ) |
Definition at line 931 of file astobj2.c.
References __ao2_ref(), AO2_ITERATOR_DONTLOCK, ao2_unlock, ao2_iterator::c, ao2_iterator::flags, and internal_ao2_iterator_next().
void* __ao2_iterator_next_debug | ( | struct ao2_iterator * | a, |
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
Definition at line 913 of file astobj2.c.
References __ao2_ref_debug(), AO2_ITERATOR_DONTLOCK, ao2_unlock, ao2_iterator::c, ao2_iterator::flags, and internal_ao2_iterator_next().
void* __ao2_link | ( | struct ao2_container * | c, |
void * | user_data | ||
) |
Definition at line 531 of file astobj2.c.
References __ao2_ref(), ao2_unlock, and internal_ao2_link().
Referenced by internal_ao2_callback().
void* __ao2_link_debug | ( | struct ao2_container * | c, |
void * | user_data, | ||
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
Definition at line 520 of file astobj2.c.
References __ao2_ref_debug(), ao2_unlock, and internal_ao2_link().
Referenced by internal_ao2_callback().
int __ao2_lock | ( | void * | a, |
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | var | ||
) |
Lock an object.
a | A pointer to the object we want to lock. |
Definition at line 161 of file astobj2.c.
References __ast_pthread_mutex_lock(), ast_atomic_fetchadd_int(), INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.
int __ao2_ref | ( | void * | user_data, |
const int | delta | ||
) |
Definition at line 248 of file astobj2.c.
References internal_ao2_ref().
Referenced by __ao2_iterator_next(), __ao2_link(), cd_cb(), and internal_ao2_callback().
int __ao2_ref_debug | ( | void * | user_data, |
const int | delta, | ||
const char * | tag, | ||
const char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
Definition at line 219 of file astobj2.c.
References ast_get_tid(), internal_ao2_ref(), and INTERNAL_OBJ().
Referenced by __ao2_iterator_next_debug(), __ao2_link_debug(), cd_cb_debug(), dialog_ref_debug(), dialog_unref_debug(), and internal_ao2_callback().
int __ao2_trylock | ( | void * | a, |
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | var | ||
) |
Try locking– (don't block if fail)
a | A pointer to the object we want to lock. |
Definition at line 189 of file astobj2.c.
References __ast_pthread_mutex_trylock(), ast_atomic_fetchadd_int(), INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.
void* __ao2_unlink | ( | struct ao2_container * | c, |
void * | user_data | ||
) |
Definition at line 565 of file astobj2.c.
References __ao2_callback(), ao2_match_by_addr, INTERNAL_OBJ(), OBJ_NODATA, OBJ_POINTER, and OBJ_UNLINK.
void* __ao2_unlink_debug | ( | struct ao2_container * | c, |
void * | user_data, | ||
char * | tag, | ||
char * | file, | ||
int | line, | ||
const char * | funcname | ||
) |
Definition at line 554 of file astobj2.c.
References __ao2_callback_debug(), ao2_match_by_addr, INTERNAL_OBJ(), OBJ_NODATA, OBJ_POINTER, and OBJ_UNLINK.
int __ao2_unlock | ( | void * | a, |
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | var | ||
) |
Unlock an object.
a | A pointer to the object we want unlock. |
Definition at line 175 of file astobj2.c.
References __ast_pthread_mutex_unlock(), ast_atomic_fetchadd_int(), INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.
void ao2_bt | ( | void | ) |
Definition at line 90 of file astobj2.c.
References ast_bt_get_symbols(), ast_std_free(), ast_verbose(), and N1.
int ao2_container_count | ( | struct ao2_container * | c | ) |
Returns the number of elements in a container.
return the number of elements in the container
Definition at line 470 of file astobj2.c.
References ao2_container::elements.
Referenced by __ast_data_register(), __ast_manager_event_multichan(), __queues_show(), _sip_show_peers(), ast_active_channels(), ast_data_search_match(), ast_merge_contexts_and_delete(), ast_srtp_unprotect(), ast_tone_zone_count(), calc_metric(), cc_cli_output_status(), cleanup(), cli_fax_show_sessions(), cli_tps_report(), data_odbc_provider_handler(), data_provider_release(), data_provider_release_all(), do_monitor(), do_timing(), endelm(), get_unused_callno(), handle_cli_iax2_show_callno_limits(), handle_show_hint(), handle_show_hints(), hints_data_provider_get(), locals_show(), lock_broker(), match_filter(), meetme_data_provider_get(), member_add_to_queue(), pthread_timer_open(), queue_exec(), queue_function_qac(), queues_data_provider_get_helper(), sla_in_use(), try_calling(), and unload_module().
void ao2_iterator_destroy | ( | struct ao2_iterator * | i | ) |
Destroy a container iterator.
destroy an iterator
Definition at line 833 of file astobj2.c.
References AO2_ITERATOR_MALLOCD, ao2_ref, ast_free, ao2_iterator::c, and ao2_iterator::flags.
Referenced by __ast_data_search_cmp_structure(), __ast_manager_event_multichan(), __data_result_print_cli(), __iax2_show_peers(), __queues_show(), _sip_show_peers(), action_meetmelist(), alias_show(), ast_channel_iterator_destroy(), ast_data_iterator_end(), ast_data_search_match(), ast_merge_contexts_and_delete(), ast_srtp_unprotect(), ast_var_indications(), ast_var_indications_table(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate(), authenticate_reply(), build_dialplan_useage_map(), calendar_query_exec(), check_access(), clear_queue(), clear_stats(), cli_console_active(), cli_fax_show_sessions(), cli_list_devices(), cli_tps_report(), compare_weight(), complete_core_id(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_queue(), complete_queue_remove_member(), complete_sip_peer(), complete_sip_registered_peer(), complete_sip_user(), complete_sipch(), complete_userno(), conf_queue_dtmf(), data_filter_find(), data_get_xml_add_child(), data_odbc_provider_handler(), data_provider_print_cli(), data_provider_release_all(), data_result_generate_node(), data_result_manager_output(), destroy_pvts(), dialgroup_read(), do_parking_thread(), dump_queue_members(), extension_state_cb(), fax_session_tab_complete(), find_call(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_indication_show(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_odbc_show(), handle_cli_status(), handle_feature_show(), handle_parkedcalls(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_showmanconn(), handle_statechange(), hints_data_provider_get(), iax2_getpeername(), iax2_getpeertrunk(), interface_exists(), kill_duplicate_offers(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_optimize_away(), manager_parking_status(), manager_queues_status(), manager_queues_summary(), meetme_menu_admin_extended(), meetme_show_cmd(), moh_rescan_files(), num_available_members(), peers_data_provider_get(), poke_all_peers(), prune_peers(), prune_users(), purge_sessions(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_queuememberpaused(), queue_function_queuememberstatus(), queues_data_provider_get(), queues_data_provider_get_helper(), reload(), rt_handle_member_record(), set_member_paused(), set_member_penalty(), sip_poke_all_peers(), sip_prune_realtime(), sip_show_channel(), sip_show_history(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), sla_calc_station_delays(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), stop_streams(), tps_taskprocessor_tab_complete(), try_calling(), unload_module(), update_queue(), update_realtime_members(), and users_data_provider_get().
struct ao2_iterator ao2_iterator_init | ( | struct ao2_container * | c, |
int | flags | ||
) |
Create an iterator for a container.
initialize an iterator so we start from the first object
Definition at line 818 of file astobj2.c.
References ao2_ref, ao2_iterator::c, and ao2_iterator::flags.
Referenced by __ast_data_search_cmp_structure(), __ast_manager_event_multichan(), __data_result_print_cli(), __iax2_show_peers(), __queues_show(), action_meetmelist(), alias_show(), ast_channel_iterator_all_new(), ast_data_iterator_init(), ast_data_search_match(), ast_merge_contexts_and_delete(), ast_srtp_unprotect(), ast_tone_zone_iterator_init(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate(), authenticate_reply(), build_dialplan_useage_map(), calendar_query_exec(), check_access(), clear_queue(), clear_stats(), cli_console_active(), cli_fax_show_sessions(), cli_list_devices(), cli_tps_report(), compare_weight(), complete_core_id(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_queue(), complete_queue_remove_member(), complete_sip_peer(), complete_sip_registered_peer(), complete_sip_user(), complete_sipch(), complete_userno(), conf_queue_dtmf(), data_filter_find(), data_get_xml_add_child(), data_odbc_provider_handler(), data_provider_print_cli(), data_provider_release_all(), data_result_generate_node(), data_result_manager_output(), destroy_pvts(), dialgroup_read(), do_parking_thread(), dump_queue_members(), extension_state_cb(), fax_session_tab_complete(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_odbc_show(), handle_cli_status(), handle_feature_show(), handle_parkedcalls(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_showmanconn(), handle_statechange(), hints_data_provider_get(), iax2_getpeername(), iax2_getpeertrunk(), interface_exists(), internal_ao2_callback(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_optimize_away(), manager_parking_status(), manager_queues_status(), manager_queues_summary(), meetme_menu_admin_extended(), meetme_show_cmd(), moh_rescan_files(), num_available_members(), peers_data_provider_get(), poke_all_peers(), prune_peers(), prune_users(), purge_sessions(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_queuememberpaused(), queue_function_queuememberstatus(), queues_data_provider_get(), queues_data_provider_get_helper(), reload(), rt_handle_member_record(), set_member_paused(), set_member_penalty(), sip_poke_all_peers(), sip_prune_realtime(), sip_show_channel(), sip_show_history(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), sla_calc_station_delays(), sla_change_trunk_state(), sla_queue_event_conf(), sla_show_stations(), sla_show_trunks(), stop_streams(), tps_taskprocessor_tab_complete(), try_calling(), unload_module(), update_queue(), update_realtime_members(), and users_data_provider_get().
int ao2_match_by_addr | ( | void * | user_data, |
void * | arg, | ||
int | flags | ||
) |
another convenience function is a callback that matches on address
Definition at line 545 of file astobj2.c.
References CMP_MATCH, and CMP_STOP.
void* ao2_object_get_lockaddr | ( | void * | obj | ) |
Return the lock address of an object.
[in] | obj | A pointer to the object we want. |
This function comes in handy mainly for debugging locking situations, where the locking trace code reports the lock address, this allows you to correlate against object address, to match objects to reported locks.
Definition at line 205 of file astobj2.c.
References INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.
|
static |
Definition at line 1137 of file astobj2.c.
References ARRAY_LEN, and ast_cli_unregister_multiple().
Referenced by astobj2_init().
int astobj2_init | ( | void | ) |
Provided by astobj2.c
Definition at line 1150 of file astobj2.c.
References ARRAY_LEN, ast_cli_register_multiple(), ast_config_AST_LOG_DIR, ast_log(), ast_register_atexit(), astobj2_cleanup(), and LOG_ERROR.
Referenced by main().
|
static |
special callback that matches all
Definition at line 578 of file astobj2.c.
References CMP_MATCH.
Referenced by internal_ao2_callback().
|
static |
similar to cb_true, but is an ao2_callback_data_fn instead
Definition at line 586 of file astobj2.c.
References CMP_MATCH.
Referenced by internal_ao2_callback().
|
static |
Definition at line 952 of file astobj2.c.
References __ao2_ref().
Referenced by container_destruct().
|
static |
Definition at line 958 of file astobj2.c.
References __ao2_ref_debug().
Referenced by container_destruct_debug().
|
static |
Definition at line 964 of file astobj2.c.
References __ao2_callback(), ast_atomic_fetchadd_int(), ast_free, AST_LIST_REMOVE_HEAD, ao2_container::buckets, cd_cb(), bucket_entry::entry, ao2_container::n_buckets, and OBJ_UNLINK.
Referenced by __ao2_container_alloc(), and __ao2_container_alloc_debug().
|
static |
Definition at line 984 of file astobj2.c.
References __ao2_callback_debug(), ast_atomic_fetchadd_int(), ast_free, AST_LIST_REMOVE_HEAD, ao2_container::buckets, cd_cb_debug(), bucket_entry::entry, ao2_container::n_buckets, and OBJ_UNLINK.
Referenced by __ao2_container_alloc_debug().
|
static |
always zero hash function
it is convenient to have a hash function that always returns 0. This is basically used when we want to have a container that is a simple linked list.
Definition at line 412 of file astobj2.c.
Referenced by internal_ao2_container_alloc().
|
static |
Definition at line 302 of file astobj2.c.
References __ast_calloc(), AO2_MAGIC, ast_atomic_fetchadd_int(), ast_calloc, ast_mutex_init, __priv_data::data_size, __priv_data::destructor_fn, EXTERNAL_OBJ, __priv_data::lock, __priv_data::magic, astobj2::priv_data, and __priv_data::ref_counter.
Referenced by __ao2_alloc(), and __ao2_alloc_debug().
|
static |
Browse the container using different stategies accoding the flags.
Definition at line 599 of file astobj2.c.
References __ao2_link(), __ao2_link_debug(), __ao2_ref(), __ao2_ref_debug(), ao2_container_alloc, AO2_ITERATOR_DONTLOCK, ao2_iterator_init(), AO2_ITERATOR_MALLOCD, AO2_ITERATOR_UNLINK, ao2_lock, ao2_ref, ao2_unlock, ast_atomic_fetchadd_int(), ast_calloc, ast_free, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, bucket_entry::astobj, ao2_container::buckets, cb_true(), cb_true_data(), CMP_MATCH, CMP_STOP, ao2_container::elements, bucket_entry::entry, EXTERNAL_OBJ, ao2_container::hash_fn, INTERNAL_OBJ(), last, match(), ao2_container::n_buckets, OBJ_CONTINUE, OBJ_MULTIPLE, OBJ_NODATA, OBJ_POINTER, OBJ_UNLINK, ao2_container::version, and WITH_DATA.
Referenced by __ao2_callback(), __ao2_callback_data(), __ao2_callback_data_debug(), and __ao2_callback_debug().
|
static |
Referenced by __ao2_container_alloc(), and __ao2_container_alloc_debug().
|
static |
Definition at line 420 of file astobj2.c.
References ast_atomic_fetchadd_int(), ao2_container::cmp_fn, ao2_container::hash_fn, hash_zero(), ao2_container::n_buckets, and ao2_container::version.
|
static |
Definition at line 846 of file astobj2.c.
References AO2_ITERATOR_DONTLOCK, AO2_ITERATOR_UNLINK, ao2_lock, ast_atomic_fetchadd_int(), ast_free, AST_LIST_NEXT, AST_LIST_REMOVE, AST_LIST_TRAVERSE, bucket_entry::astobj, ao2_iterator::bucket, ao2_container::buckets, ao2_iterator::c, ao2_iterator::c_version, ao2_container::elements, bucket_entry::entry, EXTERNAL_OBJ, ao2_iterator::flags, INTERNAL_OBJ(), ao2_container::n_buckets, ao2_iterator::obj, ao2_container::version, bucket_entry::version, and ao2_iterator::version.
Referenced by __ao2_iterator_next(), and __ao2_iterator_next_debug().
|
static |
Definition at line 490 of file astobj2.c.
References ao2_lock, ast_atomic_fetchadd_int(), ast_calloc, AST_LIST_INSERT_TAIL, bucket_entry::astobj, INTERNAL_OBJ(), OBJ_POINTER, and bucket_entry::version.
Referenced by __ao2_link(), and __ao2_link_debug().
|
static |
Definition at line 253 of file astobj2.c.
References ast_atomic_fetchadd_int(), ast_free, ast_log(), ast_mutex_destroy, __priv_data::data_size, __priv_data::destructor_fn, INTERNAL_OBJ(), __priv_data::lock, LOG_ERROR, astobj2::priv_data, and __priv_data::ref_counter.
Referenced by __ao2_ref(), and __ao2_ref_debug().
|
static |
convert from a pointer _p to a user-defined object
Definition at line 112 of file astobj2.c.
References AO2_MAGIC, ast_assert, ast_log(), LOG_ERROR, __priv_data::magic, and astobj2::priv_data.
Referenced by __ao2_lock(), __ao2_ref_debug(), __ao2_trylock(), __ao2_unlink(), __ao2_unlink_debug(), __ao2_unlock(), ao2_object_get_lockaddr(), internal_ao2_callback(), internal_ao2_iterator_next(), internal_ao2_link(), and internal_ao2_ref().