diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-12-02 01:49:43 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-12-02 02:45:00 +0700 |
commit | b43ce424115ec3e9395263a646a35e433e07cebe (patch) | |
tree | 30e9da41b37284fdcbe5eddc6edce3537c698dea | |
parent | 69ae238f1ef51979d6ff220b24ec246218da24b4 (diff) |
e1_input.c: make reference counting get() / put() more verbose
Change-Id: I1c730d6d146b365712b28e3d37e038344ea850bc
-rw-r--r-- | src/e1_input.c | 11 |
1 files 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. |