From 8061d9f66f636ada714f719be9809ea58cd5c871 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 19 Aug 2016 15:09:45 -0400 Subject: Fix naming mismatch of allocator functions. Allocator functions that take file/line/func parameters are prefixed with single-underscore when MALLOC_DEBUG is not defined, double-underscore when it is defined. This change updates all allocators that accept file/line/func to have the same prototype in either ABI mode. The parameter order of __ast_vasprintf and __ast_asprintf in utils.h have been changed to match that of astmm.h. End-use allocator macro's have been removed from astmm.h and moved to an unconditional part of utils.h. Change-Id: I823bb6ce2b5675b3a4735948f10a3b420e9a023a --- main/astobj2.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'main/astobj2.c') diff --git a/main/astobj2.c b/main/astobj2.c index ed91577be..5c92f263f 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -591,11 +591,7 @@ void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned in switch (options & AO2_ALLOC_OPT_LOCK_MASK) { case AO2_ALLOC_OPT_LOCK_MUTEX: -#if defined(__AST_DEBUG_MALLOC) obj_mutex = __ast_calloc(1, sizeof(*obj_mutex) + data_size, file, line, func); -#else - obj_mutex = ast_calloc(1, sizeof(*obj_mutex) + data_size); -#endif if (obj_mutex == NULL) { return NULL; } @@ -604,11 +600,7 @@ void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned in obj = (struct astobj2 *) &obj_mutex->priv_data; break; case AO2_ALLOC_OPT_LOCK_RWLOCK: -#if defined(__AST_DEBUG_MALLOC) obj_rwlock = __ast_calloc(1, sizeof(*obj_rwlock) + data_size, file, line, func); -#else - obj_rwlock = ast_calloc(1, sizeof(*obj_rwlock) + data_size); -#endif if (obj_rwlock == NULL) { return NULL; } @@ -617,11 +609,7 @@ void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn, unsigned in obj = (struct astobj2 *) &obj_rwlock->priv_data; break; case AO2_ALLOC_OPT_LOCK_NOLOCK: -#if defined(__AST_DEBUG_MALLOC) obj = __ast_calloc(1, sizeof(*obj) + data_size, file, line, func); -#else - obj = ast_calloc(1, sizeof(*obj) + data_size); -#endif if (obj == NULL) { return NULL; } -- cgit v1.2.3