[Asterisk-code-review] MALLOC DEBUG: Replace WRAP LIBC MALLOC with ASTMM LIBC. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Tue May 12 17:31:54 CDT 2015


Hello Richard Mudgett, Joshua Colp,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/442

to look at the new patch set (#2).

Change subject: MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC.
......................................................................

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
---
M codecs/lpc10/lpcini.c
M contrib/scripts/get_mp3_source.sh
M include/asterisk/astmm.h
M main/ast_expr2.c
M main/ast_expr2.y
M main/ast_expr2f.c
M main/hashtab.c
M res/ael/ael.flex
M res/ael/ael.tab.c
M res/ael/ael.y
M res/ael/ael_lex.c
M res/ael/pval.c
M res/res_fax_spandsp.c
M res/snmp/agent.c
M utils/extconf.c
15 files changed, 57 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/442/2
-- 
To view, visit https://gerrit.asterisk.org/442
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8afef4bc7f3b93914263ae27d3a5858b69663fc7
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list