return -1;
}
- if (!(opt = ao2_alloc(sizeof(*opt), config_option_destroy))) {
+ opt = ao2_alloc_options(sizeof(*opt), config_option_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);
+ if (!opt) {
return -1;
}
return -1;
}
- if (!(opt = ao2_alloc(sizeof(*opt) + argc * sizeof(opt->args[0]), config_option_destroy))) {
+ opt = ao2_alloc_options(sizeof(*opt) + argc * sizeof(opt->args[0]),
+ config_option_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);
+ if (!opt) {
return -1;
}
}
AST_LIST_TRAVERSE_SAFE_END;
- if (!(ts = ao2_alloc(sizeof(*ts), ast_tone_zone_sound_destructor))) {
+ ts = ao2_alloc_options(sizeof(*ts), ast_tone_zone_sound_destructor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
+ if (!ts) {
return -1;
}
mod->info = info;
#ifdef REF_DEBUG
- mod->ref_debug = ao2_t_alloc(0, NULL, info->name);
+ mod->ref_debug = ao2_t_alloc_options(0, NULL, AO2_ALLOC_OPT_LOCK_NOLOCK, info->name);
#endif
AST_LIST_HEAD_INIT(&mod->users);
size_t str_sz = strlen(variant_str) + 1;
struct media_variant *variant;
- variant = ao2_alloc(sizeof(*variant) + str_sz, media_variant_destroy);
+ variant = ao2_alloc_options(sizeof(*variant) + str_sz, media_variant_destroy,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (!variant) {
return NULL;
}
static struct media_info *media_info_alloc(const char *name)
{
size_t name_sz = strlen(name) + 1;
- struct media_info *info = ao2_alloc(sizeof(*info) + name_sz, media_info_destroy);
+ struct media_info *info;
+ info = ao2_alloc_options(sizeof(*info) + name_sz, media_info_destroy,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (!info) {
return NULL;
}
{
struct ast_xml_doc_item *item;
- if (!(item = ao2_alloc(sizeof(*item), ast_xml_doc_item_destructor))) {
+ item = ao2_alloc_options(sizeof(*item), ast_xml_doc_item_destructor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
+ if (!item) {
ast_log(AST_LOG_ERROR, "Failed to allocate memory for ast_xml_doc_item instance\n");
return NULL;
}