[svn-commits] coreyfarrell: branch 12 r418996 - /branches/12/main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jul 18 14:53:39 CDT 2014


Author: coreyfarrell
Date: Fri Jul 18 14:53:31 2014
New Revision: 418996

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418996
Log:
stasis: use ao2_t_alloc for certain object allocators

Add tags to stasis objects using the name.  This makes it
easier to track the source of certain stasis ref leaks.

Review: https://reviewboard.asterisk.org/r/3821/

Modified:
    branches/12/main/stasis.c
    branches/12/main/stasis_cache_pattern.c
    branches/12/main/stasis_message.c
    branches/12/main/stasis_message_router.c

Modified: branches/12/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/stasis.c?view=diff&rev=418996&r1=418995&r2=418996
==============================================================================
--- branches/12/main/stasis.c (original)
+++ branches/12/main/stasis.c Fri Jul 18 14:53:31 2014
@@ -204,7 +204,7 @@
 	struct stasis_topic *topic;
 	int res = 0;
 
-	topic = ao2_alloc(sizeof(*topic), topic_dtor);
+	topic = ao2_t_alloc(sizeof(*topic), topic_dtor, name);
 	if (!topic) {
 		return NULL;
 	}
@@ -311,7 +311,7 @@
 	}
 
 	/* The ao2 lock is used for join_cond. */
-	sub = ao2_alloc(sizeof(*sub), subscription_dtor);
+	sub = ao2_t_alloc(sizeof(*sub), subscription_dtor, topic->name);
 	if (!sub) {
 		return NULL;
 	}

Modified: branches/12/main/stasis_cache_pattern.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/stasis_cache_pattern.c?view=diff&rev=418996&r1=418995&r2=418996
==============================================================================
--- branches/12/main/stasis_cache_pattern.c (original)
+++ branches/12/main/stasis_cache_pattern.c Fri Jul 18 14:53:31 2014
@@ -70,7 +70,7 @@
 	RAII_VAR(char *, cached_name, NULL, ast_free);
 	RAII_VAR(struct stasis_cp_all *, all, NULL, ao2_cleanup);
 
-	all = ao2_alloc(sizeof(*all), all_dtor);
+	all = ao2_t_alloc(sizeof(*all), all_dtor, name);
 	if (!all) {
 		return NULL;
 	}
@@ -138,7 +138,7 @@
 {
 	RAII_VAR(struct stasis_cp_single *, one, NULL, ao2_cleanup);
 
-	one = ao2_alloc(sizeof(*one), one_dtor);
+	one = ao2_t_alloc(sizeof(*one), one_dtor, name);
 	if (!one) {
 		return NULL;
 	}

Modified: branches/12/main/stasis_message.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/stasis_message.c?view=diff&rev=418996&r1=418995&r2=418996
==============================================================================
--- branches/12/main/stasis_message.c (original)
+++ branches/12/main/stasis_message.c Fri Jul 18 14:53:31 2014
@@ -55,7 +55,7 @@
 {
 	struct stasis_message_type *type;
 
-	type = ao2_alloc(sizeof(*type), message_type_dtor);
+	type = ao2_t_alloc(sizeof(*type), message_type_dtor, name);
 	if (!type) {
 		return NULL;
 	}
@@ -108,7 +108,7 @@
 		return NULL;
 	}
 
-	message = ao2_alloc(sizeof(*message), stasis_message_dtor);
+	message = ao2_t_alloc(sizeof(*message), stasis_message_dtor, type->name);
 	if (message == NULL) {
 		return NULL;
 	}
@@ -191,4 +191,4 @@
 struct ast_event *stasis_message_to_event(struct stasis_message *msg)
 {
 	return INVOKE_VIRTUAL(to_event, msg);
-}
+}

Modified: branches/12/main/stasis_message_router.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/stasis_message_router.c?view=diff&rev=418996&r1=418995&r2=418996
==============================================================================
--- branches/12/main/stasis_message_router.c (original)
+++ branches/12/main/stasis_message_router.c Fri Jul 18 14:53:31 2014
@@ -212,7 +212,7 @@
 	int res;
 	RAII_VAR(struct stasis_message_router *, router, NULL, ao2_cleanup);
 
-	router = ao2_alloc(sizeof(*router), router_dtor);
+	router = ao2_t_alloc(sizeof(*router), router_dtor, topic->name);
 	if (!router) {
 		return NULL;
 	}




More information about the svn-commits mailing list