diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/astobj2.c | 12 | ||||
-rw-r--r-- | main/ccss.c | 4 | ||||
-rw-r--r-- | main/datastore.c | 6 | ||||
-rw-r--r-- | main/stringfields.c | 4 | ||||
-rw-r--r-- | main/utils.c | 2 |
5 files changed, 1 insertions, 27 deletions
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; } diff --git a/main/ccss.c b/main/ccss.c index 307f71b96..13831b719 100644 --- a/main/ccss.c +++ b/main/ccss.c @@ -682,11 +682,7 @@ void ast_cc_default_config_params(struct ast_cc_config_params *params) struct ast_cc_config_params *__ast_cc_config_params_init(const char *file, int line, const char *function) { -#if defined(__AST_DEBUG_MALLOC) struct ast_cc_config_params *params = __ast_malloc(sizeof(*params), file, line, function); -#else - struct ast_cc_config_params *params = ast_malloc(sizeof(*params)); -#endif if (!params) { return NULL; diff --git a/main/datastore.c b/main/datastore.c index c2bba4190..e536d601b 100644 --- a/main/datastore.c +++ b/main/datastore.c @@ -47,15 +47,9 @@ struct ast_datastore *__ast_datastore_alloc(const struct ast_datastore_info *inf return NULL; } -#if defined(__AST_DEBUG_MALLOC) if (!(datastore = __ast_calloc(1, sizeof(*datastore), file, line, function))) { return NULL; } -#else - if (!(datastore = ast_calloc(1, sizeof(*datastore)))) { - return NULL; - } -#endif datastore->info = info; diff --git a/main/stringfields.c b/main/stringfields.c index e82b49b98..25c584462 100644 --- a/main/stringfields.c +++ b/main/stringfields.c @@ -60,11 +60,7 @@ static size_t optimal_alloc_size(size_t size) static void *calloc_wrapper(unsigned int num_structs, size_t struct_size, const char *file, int lineno, const char *func) { -#if defined(__AST_DEBUG_MALLOC) return __ast_calloc(num_structs, struct_size, file, lineno, func); -#else - return ast_calloc(num_structs, struct_size); -#endif } /*! \brief add a new block to the pool. diff --git a/main/utils.c b/main/utils.c index 1d2aa0b27..73b1c8703 100644 --- a/main/utils.c +++ b/main/utils.c @@ -2369,7 +2369,7 @@ int ast_parse_digest(const char *digest, struct ast_http_digest *d, int request, } #ifndef __AST_DEBUG_MALLOC -int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...) +int __ast_asprintf(const char *file, int lineno, const char *func, char **ret, const char *fmt, ...) { int res; va_list ap; |