lib: remove useless checks, make functions inline on fast path
[babeltrace.git] / include / babeltrace / object-internal.h
index 70391b3b95b003ddee8b9952027a05d355490a8b..6eed014c10577405a38d67e35a21716f1527a4b2 100644 (file)
@@ -251,6 +251,22 @@ void bt_object_inc_ref_count(struct bt_object *obj)
        BT_ASSERT(obj->ref_count != 0);
 }
 
+static inline
+void bt_object_get_no_null_check_no_parent_check(struct bt_object *obj)
+{
+       BT_ASSERT(obj);
+       BT_ASSERT(obj->is_shared);
+
+#ifdef BT_LOGV
+       BT_LOGV("Incrementing object's reference count: %llu -> %llu: "
+               "addr=%p, cur-count=%llu, new-count=%llu",
+               obj->ref_count, obj->ref_count + 1,
+               obj, obj->ref_count, obj->ref_count + 1);
+#endif
+
+       bt_object_inc_ref_count(obj);
+}
+
 static inline
 void bt_object_get_no_null_check(struct bt_object *obj)
 {
This page took 0.05231 seconds and 4 git commands to generate.