[Asterisk-code-review] core: Stop using AST INLINE API for allocator functions. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Mar 14 16:47:24 CDT 2018


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/8521 )

Change subject: core: Stop using AST_INLINE_API for allocator functions.
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.asterisk.org/#/c/8521/2/main/astmm.c
File main/astmm.c:

https://gerrit.asterisk.org/#/c/8521/2/main/astmm.c@1557
PS2, Line 1557: void *__ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func)
> Hmm it hadn't clicked in that your patch did that.  I'm thinking this patch
Redirecting calloc() to __ast_calloc() that logs failure and does DEBUG_CHAOS isn't quite the same thing as redirecting it to the MALLOC_DEBUG calloc replacement.

__ast_calloc() is a wrapper that adds asterisk specific behavior to calloc().

The MALLOC_DEBUG calloc replacement adds sanity checks to memory management when it is enabled it does not add new behavior.  It should not add the extra behavior that the __ast_calloc() wrapper adds.

Actually DEBUG_CHAOS should be moved into the __ast_repl_calloc() function instead of being in the __ast_calloc() function.  DEBUG_CHAOS like MALLOC_DEBUG doesn't add application specific behavior.

__ast_calloc() is known to log a memory allocation failure message.  This is true even if it isn't always believed to do so by the caller. :)   calloc() has no such logging defined since that is application specific behavior.



-- 
To view, visit https://gerrit.asterisk.org/8521
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9df4377f74bdbb627461b27a473123e05525887
Gerrit-Change-Number: 8521
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Wed, 14 Mar 2018 21:47:24 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180314/86a6dca6/attachment.html>


More information about the asterisk-code-review mailing list