From 4ccf2c7aa5e8be4a7f38170c3e7a3d1fa5beed9c Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 21 Nov 2012 18:33:16 +0000 Subject: Add red-black tree container type to astobj2. * Add red-black tree container type. * Add CLI command "astobj2 container dump " * Added ao2_container_dump() so the container could be dumped by other modules for debugging purposes. * Changed ao2_container_stats() so it can be used by other modules like ao2_container_check() for debugging purposes. * Updated the unit tests to check red-black tree containers. (closes issue ASTERISK-19970) Reported by: rmudgett Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2110/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376575 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_iax2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'channels') diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 758b2bca2..7a2528fc3 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -2774,6 +2774,10 @@ static int replace_callno(const void *obj) 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 @@ static int create_callno_pools(void) { 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; } -- cgit v1.2.3