[Asterisk-code-review] MALLOC DEBUG: Always use the API. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Thu Feb 22 10:30:05 CST 2018


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/8366 )

Change subject: MALLOC_DEBUG: Always use the API.
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

This may be crazy but how much of a performance hit would we take if __ast_calloc et al were always real functions provided by main/astmm.c instead of AST_INLINE_API in utils.h?  Then just have the implementation of main/astmm.c chosen by `#if defined(MALLOC_DEBUG)`.  I know there would be a hit, I'm just not sure it's prohibitive.

https://gerrit.asterisk.org/#/c/8366/1/include/asterisk/utils.h
File include/asterisk/utils.h:

https://gerrit.asterisk.org/#/c/8366/1/include/asterisk/utils.h@536
PS1, Line 536: #define ast_free free
> Wouldn't this still be a problem if MALLOC_DEBUG is enabled on the core and
Looking further this is a problem:
* asterisk/uuid.h - multiple functions allocate from the core documented as 'free with ast_free'.
* asterisk/astdb.h - ast_db_get_allocated
* asterisk/cli.h - ast_cli_completion_add



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic07ad80b2c2df894db984cf27b16a69383ce0e10
Gerrit-Change-Number: 8366
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Thu, 22 Feb 2018 16:30:05 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180222/9df3c85b/attachment.html>


More information about the asterisk-code-review mailing list