This accessor is added to facilitate the testing and validation
of the bt_object reference counting and aggregation mechanism.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct bt_object *obj = ptr;
obj->release = release;
struct bt_object *obj = ptr;
obj->release = release;
bt_ref_init(&obj->ref_count, generic_release);
}
bt_ref_init(&obj->ref_count, generic_release);
}
+static inline
+long bt_object_get_ref_count(const void *ptr)
+{
+ const struct bt_object *obj = ptr;
+
+ return obj->ref_count.count;
+}
+
#endif /* BABELTRACE_OBJECT_INTERNAL_H */
#endif /* BABELTRACE_OBJECT_INTERNAL_H */