[Asterisk-code-review] REF DEBUG: Prevent logging of container node objects. (asterisk[13])

Corey Farrell asteriskteam at digium.com
Thu Jul 7 12:46:40 CDT 2016


Corey Farrell has uploaded a new change for review.

  https://gerrit.asterisk.org/3159

Change subject: REF_DEBUG: Prevent logging of container node objects.
......................................................................

REF_DEBUG: Prevent logging of container node objects.

Using AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE can result in an unref being
recorded to the refs log for the node being replaced.  This prevents
logging of those unrefs since they would produce errors in
refcounter.py.

ASTERISK-26181 #close

Change-Id: Ie4fded84e8a1a58b3a59ce59dfd7eb0da3ddc5d4
---
M main/astobj2_hash.c
M main/astobj2_rbtree.c
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/3159/1

diff --git a/main/astobj2_hash.c b/main/astobj2_hash.c
index 1cd6ee2..341ff79 100644
--- a/main/astobj2_hash.c
+++ b/main/astobj2_hash.c
@@ -298,7 +298,7 @@
 					break;
 				case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
 					SWAP(cur->common.obj, node->common.obj);
-					ao2_t_ref(node, -1, "Discard the new node.");
+					__ao2_ref(node, -1);
 					return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
 				}
 			}
@@ -331,7 +331,7 @@
 					break;
 				case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
 					SWAP(cur->common.obj, node->common.obj);
-					ao2_t_ref(node, -1, "Discard the new node.");
+					__ao2_ref(node, -1);
 					return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
 				}
 			}
diff --git a/main/astobj2_rbtree.c b/main/astobj2_rbtree.c
index d8195d4..a8d5e3a 100644
--- a/main/astobj2_rbtree.c
+++ b/main/astobj2_rbtree.c
@@ -1267,7 +1267,7 @@
 		break;
 	case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
 		SWAP(cur->common.obj, node->common.obj);
-		ao2_t_ref(node, -1, "Don't need the new node.");
+		__ao2_ref(node, -1);
 		return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/3159
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4fded84e8a1a58b3a59ce59dfd7eb0da3ddc5d4
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Corey Farrell <git at cfware.com>



More information about the asterisk-code-review mailing list