lib/ref.c: logging: show current count and new count in messages
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 14 May 2017 06:55:24 +0000 (02:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:43 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ref.c

index d39a24d0c1bc5121f4082b5f3eb7ed039a4faae1..3a9cb61c60f1c4af99bc23d7bcff7274e690f809 100644 (file)
--- a/lib/ref.c
+++ b/lib/ref.c
@@ -43,10 +43,12 @@ void *bt_get(void *ptr)
                        "addr=%p, parent-addr=%p", ptr, obj->parent);
                bt_get(obj->parent);
        }
+       BT_LOGV("Incrementing object's reference count: %lu -> %lu: "
+               "addr=%p, cur-count=%lu, new-count=%lu",
+               obj->ref_count.count, obj->ref_count.count + 1,
+               ptr,
+               obj->ref_count.count, obj->ref_count.count + 1);
        bt_ref_get(&obj->ref_count);
-       BT_LOGV("Incremented object's reference count: %lu -> %lu: "
-               "addr=%p, new-count=%lu", obj->ref_count.count - 1,
-               obj->ref_count.count, ptr, obj->ref_count.count);
 end:
        return obj;
 }
@@ -60,7 +62,9 @@ void bt_put(void *ptr)
        }
 
        BT_LOGV("Decrementing object's reference count: %lu -> %lu: "
-               "addr=%p, cur-count=%lu", obj->ref_count.count,
-               obj->ref_count.count - 1, ptr, obj->ref_count.count);
+               "addr=%p, cur-count=%lu, new-count=%lu",
+               obj->ref_count.count, obj->ref_count.count - 1,
+               ptr,
+               obj->ref_count.count, obj->ref_count.count - 1);
        bt_ref_put(&obj->ref_count);
 }
This page took 0.024415 seconds and 4 git commands to generate.