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
This commit is contained in:
Corey Farrell
2016-08-19 15:09:45 -04:00
parent c6ed91a9c8
commit 8061d9f66f
9 changed files with 127 additions and 211 deletions

View File

@@ -174,35 +174,11 @@ void __ast_mm_init_phase_2(void);
#endif
/* Provide our own definitions */
#define ast_calloc(a,b) \
__ast_calloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define ast_calloc_cache(a,b) \
__ast_calloc_cache(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define ast_malloc(a) \
__ast_malloc(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
/* Provide our own definition for ast_free */
#define ast_free(a) \
__ast_free(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define ast_realloc(a,b) \
__ast_realloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define ast_strdup(a) \
__ast_strdup(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define ast_strndup(a,b) \
__ast_strndup(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define ast_asprintf(a, b, c...) \
__ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, b, c)
#define ast_vasprintf(a,b,c) \
__ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)
#endif /* !STANDALONE */
#else