From b43ce424115ec3e9395263a646a35e433e07cebe Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 2 Dec 2019 01:49:43 +0700 Subject: e1_input.c: make reference counting get() / put() more verbose Change-Id: I1c730d6d146b365712b28e3d37e038344ea850bc --- src/e1_input.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/e1_input.c b/src/e1_input.c index 4717830..eb973ef 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -419,12 +419,19 @@ e1inp_line_clone(void *ctx, struct e1inp_line *line) void e1inp_line_get(struct e1inp_line *line) { - line->refcnt++; + int old_refcnt = line->refcnt++; + + LOGP(DLINP, LOGL_DEBUG, "Line '%s' (%p) reference count get: %d -> %d\n", + line->name, line, old_refcnt, line->refcnt); } void e1inp_line_put(struct e1inp_line *line) { - line->refcnt--; + int old_refcnt = line->refcnt--; + + LOGP(DLINP, LOGL_DEBUG, "Line '%s' (%p) reference count put: %d -> %d\n", + line->name, line, old_refcnt, line->refcnt); + if (line->refcnt == 0) { /* Remove our counter group from libosmocore's global counter * list if we are freeing the last remaining talloc context. -- cgit v1.2.3