Skip to content
Snippets Groups Projects
  • Corey Farrell's avatar
    478fb4a3
    MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC. · 478fb4a3
    Corey Farrell authored
    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
    478fb4a3
    History
    MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC.
    Corey Farrell authored
    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