summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-11-29 00:48:12 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-11-29 00:48:12 +0000
commit2686dde98b552db3796e63572bd468a54218313b (patch)
treec61f48216850eb3f836d655cffb3219c912df29e /main/asterisk.c
parente3a487d4924699e1eecf86044c1f9ca5efaa9f68 (diff)
Add MALLOC_DEBUG atexit unreleased malloc memory summary.
* Adds the following CLI commands to control MALLOC_DEBUG reporting of unreleased malloc memory when Asterisk is shut down. memory atexit list on memory atexit list off memory atexit summary byline memory atexit summary byfunc memory atexit summary byfile memory atexit summary off * Made check all remaining allocated region blocks atexit for fence violations. * Increased the allocated region hash table size by about three times. It still isn't large enough considering the number of malloced blocks Asterisk uses. * Made CLI "memory show allocations anomalies" use regions_check_all_fences(). Review: https://reviewboard.asterisk.org/r/2196/ ........ Merged revisions 376788 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376789 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376790 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 637bf1277..6085e9589 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3965,6 +3965,10 @@ int main(int argc, char *argv[])
* an Asterisk instance, and that there isn't one already running. */
multi_thread_safe = 1;
+#if defined(__AST_DEBUG_MALLOC)
+ __ast_mm_init_phase_1();
+#endif /* defined(__AST_DEBUG_MALLOC) */
+
/* Spawning of astcanary must happen AFTER the call to daemon(3) */
if (isroot && ast_opt_high_priority) {
snprintf(canary_filename, sizeof(canary_filename), "%s/alt.asterisk.canary.tweet.tweet.tweet", ast_config_AST_RUN_DIR);
@@ -4034,10 +4038,6 @@ int main(int argc, char *argv[])
ast_el_read_history(filename);
}
-#if defined(__AST_DEBUG_MALLOC)
- __ast_mm_init_phase_1();
-#endif /* defined(__AST_DEBUG_MALLOC) */
-
ast_ulaw_init();
ast_alaw_init();
tdd_init();
@@ -4271,9 +4271,9 @@ int main(int argc, char *argv[])
pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
-#ifdef __AST_DEBUG_MALLOC
+#if defined(__AST_DEBUG_MALLOC)
__ast_mm_init_phase_2();
-#endif
+#endif /* defined(__AST_DEBUG_MALLOC) */
ast_lastreloadtime = ast_startuptime = ast_tvnow();
ast_cli_register_multiple(cli_asterisk, ARRAY_LEN(cli_asterisk));