diff mbox series

[v2,12/17] gweb: Add reference count debug statements.

Message ID 20231119170714.775270-13-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Address Redundant IPv4 Reachability Checks | expand

Commit Message

Grant Erickson Nov. 19, 2023, 5:07 p.m. UTC
This adds reference count debugging statements in 'g_web_ref' and
'g_web_unref', similar but not identical to other modules in the
project.
---
 gweb/gweb.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/gweb/gweb.c b/gweb/gweb.c
index 0270531a982f..7a25fe4c8cc3 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -414,6 +414,9 @@  GWeb *g_web_ref(GWeb *web)
 	if (!web)
 		return NULL;
 
+	debug(web, "ref %d",
+		web->ref_count + 1);
+
 	__sync_fetch_and_add(&web->ref_count, 1);
 
 	return web;
@@ -424,6 +427,9 @@  void g_web_unref(GWeb *web)
 	if (!web)
 		return;
 
+	debug(web, "ref %d",
+		web->ref_count - 1);
+
 	if (__sync_fetch_and_sub(&web->ref_count, 1) != 1)
 		return;