[asterisk-commits] dlee: branch group/performance r399752 - in /team/group/performance: channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 24 18:07:52 CDT 2013


Author: dlee
Date: Tue Sep 24 18:07:50 2013
New Revision: 399752

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399752
Log:
Fixed r399663 for dev build (chan_console.c this time)

Modified:
    team/group/performance/channels/chan_console.c
    team/group/performance/main/astobj2.c

Modified: team/group/performance/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/channels/chan_console.c?view=diff&rev=399752&r1=399751&r2=399752
==============================================================================
--- team/group/performance/channels/chan_console.c (original)
+++ team/group/performance/channels/chan_console.c Tue Sep 24 18:07:50 2013
@@ -76,6 +76,7 @@
 #include "asterisk/musiconhold.h"
 #include "asterisk/callerid.h"
 #include "asterisk/astobj2.h"
+#include "asterisk/stasis_channels.h"
 
 /*! 
  * \brief The sample rate to request from PortAudio 

Modified: team/group/performance/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/main/astobj2.c?view=diff&rev=399752&r1=399751&r2=399752
==============================================================================
--- team/group/performance/main/astobj2.c (original)
+++ team/group/performance/main/astobj2.c Tue Sep 24 18:07:50 2013
@@ -1946,6 +1946,8 @@
 struct hash_bucket {
 	/*! List of objects held in the bucket. */
 	AST_DLLIST_HEAD_NOLOCK(, hash_bucket_node) list;
+	/*! Next node links for the bucket skip list */
+	AST_DLLIST_ENTRY(hash_bucket) skip_links;
 #if defined(AST_DEVMODE)
 	/*! Number of elements currently in the bucket. */
 	int elements;
@@ -1966,6 +1968,8 @@
 	 */
 	struct ao2_container common;
 	ao2_hash_fn *hash_fn;
+	/*! Buckets with contents */
+	AST_DLLIST_HEAD_NOLOCK(, hash_bucket) skip_list;
 	/*! Number of hash buckets in this container. */
 	int n_buckets;
 	/*! Hash bucket array of n_buckets.  Variable size. */
@@ -2086,6 +2090,11 @@
 		bucket = &my_container->buckets[doomed->my_bucket];
 		AST_DLLIST_REMOVE(&bucket->list, doomed, links);
 		AO2_DEVMODE_STAT(--my_container->common.nodes);
+
+		/* If this bucket is empty, remove it from the skiplist */
+		if (AST_DLLIST_EMPTY(&bucket->list)) {
+			AST_DLLIST_REMOVE(&my_container->skip_list, bucket, skip_links);
+		}
 	}
 
 	/*
@@ -2159,6 +2168,11 @@
 	bucket = &self->buckets[node->my_bucket];
 	sort_fn = self->common.sort_fn;
 	options = self->common.options;
+
+	/* Add ourselves to the skip list, if needed */
+	if (AST_DLLIST_EMPTY(&bucket->list)) {
+		AST_DLLIST_INSERT_TAIL(&self->skip_list, bucket, skip_links);
+	}
 
 	if (options & AO2_CONTAINER_ALLOC_OPT_INSERT_BEGIN) {
 		if (sort_fn) {




More information about the asterisk-commits mailing list