[asterisk-commits] rmudgett: branch rmudgett/ao2_red_black r376506 - in /team/rmudgett/ao2_red_b...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 19 18:02:08 CST 2012
Author: rmudgett
Date: Mon Nov 19 18:02:04 2012
New Revision: 376506
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376506
Log:
Address mmichelson's reviewboard comments.
Modified:
team/rmudgett/ao2_red_black/channels/chan_iax2.c
team/rmudgett/ao2_red_black/main/astobj2.c
Modified: team/rmudgett/ao2_red_black/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ao2_red_black/channels/chan_iax2.c?view=diff&rev=376506&r1=376505&r2=376506
==============================================================================
--- team/rmudgett/ao2_red_black/channels/chan_iax2.c (original)
+++ team/rmudgett/ao2_red_black/channels/chan_iax2.c Mon Nov 19 18:02:04 2012
@@ -2774,6 +2774,10 @@
static int callno_hash(const void *obj, const int flags)
{
+ /*
+ * XXX A hash function should always return the same value for
+ * the same inputs.
+ */
return abs(ast_random());
}
@@ -2781,6 +2785,15 @@
{
uint16_t i;
+ /*!
+ * \todo XXX A different method of randomly picking an available
+ * IAX2 callno needs to be devised.
+ *
+ * A hash function should always return the same value for the
+ * same inputs. This game with the hash function prevents
+ * astob2.c from generically checking the integrity of hash
+ * containers while the system runs.
+ */
if (!(callno_pool = ao2_container_alloc(CALLNO_POOL_BUCKETS, callno_hash, NULL))) {
return -1;
}
Modified: team/rmudgett/ao2_red_black/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ao2_red_black/main/astobj2.c?view=diff&rev=376506&r1=376505&r2=376506
==============================================================================
--- team/rmudgett/ao2_red_black/main/astobj2.c (original)
+++ team/rmudgett/ao2_red_black/main/astobj2.c Mon Nov 19 18:02:04 2012
@@ -5316,8 +5316,9 @@
return CLI_SHOWUSAGE;
}
- if (prof_id == -1)
+ if (prof_id == -1) {
prof_id = ast_add_profile("ao2_alloc", 0);
+ }
ast_cli(a->fd, "argc %d argv %s %s %s\n", a->argc, a->argv[0], a->argv[1], a->argv[2]);
lim = atoi(a->argv[2]);
More information about the asterisk-commits
mailing list