summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-04-17 03:16:59 -0400
committerCorey Farrell <git@cfware.com>2015-04-27 18:37:26 -0400
commit5c1d07baf083fd791c8f717209551d9227413ef7 (patch)
tree7eff8c651efb82e89fd7918038102b84fe888ced /main/asterisk.c
parentd7f4788341f08f386341416aa3944c7f9bc0dc1b (diff)
Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses Astobj2. It is used to determine if reference debugging is enabled by default. Reference debugging can be enabled or disabled in asterisk.conf. * Caller information is provided in logger errors for ao2 bad magic numbers. * Optimizes AO2 by merging internal functions with the public counterpart. This was possible now that we no longer require a dual ABI. ASTERISK-24974 #close Reported by: Corey Farrell Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 574451c65..86a190bc8 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3424,6 +3424,12 @@ static void ast_readconfig(void)
ast_copy_string(cfg_paths.socket_path, DEFAULT_SOCKET, sizeof(cfg_paths.socket_path));
ast_copy_string(cfg_paths.run_dir, DEFAULT_RUN_DIR, sizeof(cfg_paths.run_dir));
+#ifdef REF_DEBUG
+ /* The REF_DEBUG compiler flag is now only used to enable refdebug by default.
+ * Support for debugging reference counts is always compiled in. */
+ ast_set2_flag(&ast_options, 1, AST_OPT_FLAG_REF_DEBUG);
+#endif
+
ast_set_default_eid(&ast_eid_default);
/* no asterisk.conf? no problem, use buildtime config! */
@@ -3494,6 +3500,8 @@ static void ast_readconfig(void)
if (sscanf(v->value, "%30d", &option_debug) != 1) {
option_debug = ast_true(v->value);
}
+ } else if (!strcasecmp(v->name, "refdebug")) {
+ ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_REF_DEBUG);
#if HAVE_WORKING_FORK
/* Disable forking (-f at startup) */
} else if (!strcasecmp(v->name, "nofork")) {