Merge "Fix error's produced by astmm.h when standard allocators are used."

This commit is contained in:
Joshua Colp 2015-05-11 05:34:05 -05:00 committed by Gerrit Code Review
commit 7b7bef722c
2 changed files with 14 additions and 12 deletions

View File

@ -95,21 +95,21 @@ void __ast_mm_init_phase_2(void);
__ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__) __ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#else #else
#define calloc(a,b) \ #define calloc(a,b) \
Do_not_use_calloc__use_ast_calloc(a,b) Do_not_use_calloc__use_ast_calloc->fail(a,b)
#define malloc(a) \ #define malloc(a) \
Do_not_use_malloc__use_ast_malloc(a) Do_not_use_malloc__use_ast_malloc->fail(a)
#define free(a) \ #define free(a) \
Do_not_use_free__use_ast_free_or_ast_std_free_for_remotely_allocated_memory(a) Do_not_use_free__use_ast_free_or_ast_std_free_for_remotely_allocated_memory->fail(a)
#define realloc(a,b) \ #define realloc(a,b) \
Do_not_use_realloc__use_ast_realloc(a,b) Do_not_use_realloc__use_ast_realloc->fail(a,b)
#define strdup(a) \ #define strdup(a) \
Do_not_use_strdup__use_ast_strdup(a) Do_not_use_strdup__use_ast_strdup->fail(a)
#define strndup(a,b) \ #define strndup(a,b) \
Do_not_use_strndup__use_ast_strndup(a,b) Do_not_use_strndup__use_ast_strndup->fail(a,b)
#define asprintf(a, b, c...) \ #define asprintf(a, b, c...) \
Do_not_use_asprintf__use_ast_asprintf(a,b,c) Do_not_use_asprintf__use_ast_asprintf->fail(a,b,c)
#define vasprintf(a,b,c) \ #define vasprintf(a,b,c) \
Do_not_use_vasprintf__use_ast_vasprintf(a,b,c) Do_not_use_vasprintf__use_ast_vasprintf->fail(a,b,c)
#endif #endif
/* Provide our own definitions */ /* Provide our own definitions */

View File

@ -48,14 +48,16 @@
<support_level>extended</support_level> <support_level>extended</support_level>
***/ ***/
#include "asterisk.h" /* Include spandsp headers before asterisk.h so the inline functions can continue using
* malloc and free, even with MALLOC_DEBUG enabled. */
ASTERISK_REGISTER_FILE()
#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES
#include <spandsp.h> #include <spandsp.h>
#include <spandsp/version.h> #include <spandsp/version.h>
#include "asterisk.h"
ASTERISK_REGISTER_FILE()
#include "asterisk/logger.h" #include "asterisk/logger.h"
#include "asterisk/module.h" #include "asterisk/module.h"
#include "asterisk/strings.h" #include "asterisk/strings.h"