From 478fb4a388afcb56e7e50184c996f0838d609a66 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Tue, 12 May 2015 09:58:52 -0400 Subject: MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC. There are 3 ways that calls directly to standard allocator functions can be dealt with: 1. Block their use, cause them to generate an error. This is the default. 2. Replace them with the Asterisk equivalent function calls. 3. Leave them alone. This change allows one of these 3 options to be selected by any source. The source just needs to define ASTMM_LIBC to ASTMM_BLOCK, ASTMM_REDIRECT, or ASTMM_IGNORE to use option 1, 2 or 3 respectively. Normally ASTMM_BLOCK is the correct option, so it is default when ASTMM_LIBC is not defined. In some cases when building 3rd party code it is desirable to have it use Asterisk functions, without changing the whole source - ASTMM_REDIRECT accomplishes this. When using 3rd party libraries sometimes a static inline function will make use of malloc or free. In these cases it may be unsafe to replace the allocator in the header, as it's possible the memory could be freed by the library using standard allocators. For those cases ASTMM_IGNORE is needed. Change-Id: I8afef4bc7f3b93914263ae27d3a5858b69663fc7 --- utils/extconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/extconf.c b/utils/extconf.c index 872980172..baca11bf5 100644 --- a/utils/extconf.c +++ b/utils/extconf.c @@ -43,7 +43,7 @@ extended ***/ -#define WRAP_LIBC_MALLOC +#define ASTMM_LIBC ASTMM_REDIRECT #include "asterisk.h" #undef DEBUG_THREADS -- cgit v1.2.3