projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: src.ctf.fs: use BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE when applicable
[babeltrace.git]
/
src
/
lib
/
object.h
diff --git
a/src/lib/object.h
b/src/lib/object.h
index b8cb33bfdf7c673450c604cf79832f2415f5aac0..25240b2000b2510074eaee8fcae143d4abb234ac 100644
(file)
--- a/
src/lib/object.h
+++ b/
src/lib/object.h
@@
-33,10
+33,10
@@
* for internal reference counting. Until we make this header generic
* for the whole project, make it possible to disable logging in this
* file by defining `BT_OBJECT_DONT_LOG` because it's possible that the
* for internal reference counting. Until we make this header generic
* for the whole project, make it possible to disable logging in this
* file by defining `BT_OBJECT_DONT_LOG` because it's possible that the
- * BT_LOG
V
() statements here won't find the log level
+ * BT_LOG
T
() statements here won't find the log level
* (`BT_LOG_OUTPUT_LEVEL`).
*/
* (`BT_LOG_OUTPUT_LEVEL`).
*/
-#if defined(BT_LOG
V
) && !defined(BT_OBJECT_DONT_LOG)
+#if defined(BT_LOG
T
) && !defined(BT_OBJECT_DONT_LOG)
# define _BT_OBJECT_LOGGING_ENABLED
#endif
# define _BT_OBJECT_LOGGING_ENABLED
#endif
@@
-47,10
+47,10
@@
typedef void (*bt_object_parent_is_owner_listener_func)(
struct bt_object *);
static inline
struct bt_object *);
static inline
-void bt_object_get_no_null_check(const void *obj);
+void bt_object_get_
ref_
no_null_check(const void *obj);
static inline
static inline
-void bt_object_put_no_null_check(const void *obj);
+void bt_object_put_
ref_
no_null_check(const void *obj);
/*
* Babeltrace object base.
/*
* Babeltrace object base.
@@
-126,7
+126,7
@@
struct bt_object *bt_object_get_parent(const struct bt_object *c_obj)
struct bt_object *parent = bt_object_borrow_parent(obj);
if (parent) {
struct bt_object *parent = bt_object_borrow_parent(obj);
if (parent) {
- bt_object_get_no_null_check(parent);
+ bt_object_get_
ref_
no_null_check(parent);
}
return parent;
}
return parent;
@@
-139,7
+139,7
@@
void bt_object_set_parent(struct bt_object *child, struct bt_object *parent)
BT_ASSERT(child->is_shared);
#ifdef _BT_OBJECT_LOGGING_ENABLED
BT_ASSERT(child->is_shared);
#ifdef _BT_OBJECT_LOGGING_ENABLED
- BT_LOG
V
("Setting object's parent: addr=%p, parent-addr=%p",
+ BT_LOG
T
("Setting object's parent: addr=%p, parent-addr=%p",
child, parent);
#endif
child, parent);
#endif
@@
-152,10
+152,10
@@
void bt_object_set_parent(struct bt_object *child, struct bt_object *parent)
if (parent) {
BT_ASSERT(!child->parent);
child->parent = parent;
if (parent) {
BT_ASSERT(!child->parent);
child->parent = parent;
- bt_object_get_no_null_check(parent);
+ bt_object_get_
ref_
no_null_check(parent);
} else {
if (child->parent) {
} else {
if (child->parent) {
- bt_object_put_no_null_check(child->parent);
+ bt_object_put_
ref_
no_null_check(child->parent);
}
child->parent = NULL;
}
child->parent = NULL;
@@
-186,7
+186,7
@@
void bt_object_with_parent_release_func(struct bt_object *obj)
struct bt_object *parent = obj->parent;
#ifdef _BT_OBJECT_LOGGING_ENABLED
struct bt_object *parent = obj->parent;
#ifdef _BT_OBJECT_LOGGING_ENABLED
- BT_LOG
V
("Releasing parented object: addr=%p, ref-count=%llu, "
+ BT_LOG
T
("Releasing parented object: addr=%p, ref-count=%llu, "
"parent-addr=%p, parent-ref-count=%llu",
obj, obj->ref_count,
parent, parent->ref_count);
"parent-addr=%p, parent-ref-count=%llu",
obj, obj->ref_count,
parent, parent->ref_count);
@@
-203,7
+203,7
@@
void bt_object_with_parent_release_func(struct bt_object *obj)
}
/* The release function will be invoked by the parent. */
}
/* The release function will be invoked by the parent. */
- bt_object_put_no_null_check(parent);
+ bt_object_put_
ref_
no_null_check(parent);
} else {
bt_object_try_spec_release(obj);
}
} else {
bt_object_try_spec_release(obj);
}
@@
-268,7
+268,7
@@
void bt_object_inc_ref_count(const struct bt_object *c_obj)
}
static inline
}
static inline
-void bt_object_get_no_null_check_no_parent_check(const struct bt_object *c_obj)
+void bt_object_get_
ref_
no_null_check_no_parent_check(const struct bt_object *c_obj)
{
struct bt_object *obj = (void *) c_obj;
{
struct bt_object *obj = (void *) c_obj;
@@
-276,7
+276,7
@@
void bt_object_get_no_null_check_no_parent_check(const struct bt_object *c_obj)
BT_ASSERT(obj->is_shared);
#ifdef _BT_OBJECT_LOGGING_ENABLED
BT_ASSERT(obj->is_shared);
#ifdef _BT_OBJECT_LOGGING_ENABLED
- BT_LOG
V
("Incrementing object's reference count: %llu -> %llu: "
+ BT_LOG
T
("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);
"addr=%p, cur-count=%llu, new-count=%llu",
obj->ref_count, obj->ref_count + 1,
obj, obj->ref_count, obj->ref_count + 1);
@@
-286,7
+286,7
@@
void bt_object_get_no_null_check_no_parent_check(const struct bt_object *c_obj)
}
static inline
}
static inline
-void bt_object_get_no_null_check(const void *c_obj)
+void bt_object_get_
ref_
no_null_check(const void *c_obj)
{
struct bt_object *obj = (void *) c_obj;
{
struct bt_object *obj = (void *) c_obj;
@@
-295,15
+295,15
@@
void bt_object_get_no_null_check(const void *c_obj)
if (G_UNLIKELY(obj->parent && bt_object_get_ref_count(obj) == 0)) {
#ifdef _BT_OBJECT_LOGGING_ENABLED
if (G_UNLIKELY(obj->parent && bt_object_get_ref_count(obj) == 0)) {
#ifdef _BT_OBJECT_LOGGING_ENABLED
- BT_LOG
V
("Incrementing object's parent's reference count: "
+ BT_LOG
T
("Incrementing object's parent's reference count: "
"addr=%p, parent-addr=%p", obj, obj->parent);
#endif
"addr=%p, parent-addr=%p", obj, obj->parent);
#endif
- bt_object_get_no_null_check(obj->parent);
+ bt_object_get_
ref_
no_null_check(obj->parent);
}
#ifdef _BT_OBJECT_LOGGING_ENABLED
}
#ifdef _BT_OBJECT_LOGGING_ENABLED
- BT_LOG
V
("Incrementing object's reference count: %llu -> %llu: "
+ BT_LOG
T
("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);
"addr=%p, cur-count=%llu, new-count=%llu",
obj->ref_count, obj->ref_count + 1,
obj, obj->ref_count, obj->ref_count + 1);
@@
-313,7
+313,7
@@
void bt_object_get_no_null_check(const void *c_obj)
}
static inline
}
static inline
-void bt_object_put_no_null_check(const void *c_obj)
+void bt_object_put_
ref_
no_null_check(const void *c_obj)
{
struct bt_object *obj = (void *) c_obj;
{
struct bt_object *obj = (void *) c_obj;
@@
-322,7
+322,7
@@
void bt_object_put_no_null_check(const void *c_obj)
BT_ASSERT(obj->ref_count > 0);
#ifdef _BT_OBJECT_LOGGING_ENABLED
BT_ASSERT(obj->ref_count > 0);
#ifdef _BT_OBJECT_LOGGING_ENABLED
- BT_LOG
V
("Decrementing object's reference count: %llu -> %llu: "
+ BT_LOG
T
("Decrementing 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);
"addr=%p, cur-count=%llu, new-count=%llu",
obj->ref_count, obj->ref_count - 1,
obj, obj->ref_count, obj->ref_count - 1);
@@
-345,11
+345,11
@@
void bt_object_get_ref(const void *ptr)
return;
}
return;
}
-#ifdef BT_ASSERT_PRE
- BT_ASSERT_PRE(obj->is_shared, "Object is not shared: %!+O", obj);
+#ifdef BT_ASSERT_PRE
_DEV
+ BT_ASSERT_PRE
_DEV
(obj->is_shared, "Object is not shared: %!+O", obj);
#endif
#endif
- bt_object_get_no_null_check(obj);
+ bt_object_get_
ref_
no_null_check(obj);
}
static inline
}
static inline
@@
-361,13
+361,13
@@
void bt_object_put_ref(const void *ptr)
return;
}
return;
}
-#ifdef BT_ASSERT_PRE
- BT_ASSERT_PRE(obj->is_shared, "Object is not shared: %!+O", obj);
- BT_ASSERT_PRE(bt_object_get_ref_count(obj) > 0,
+#ifdef BT_ASSERT_PRE
_DEV
+ BT_ASSERT_PRE
_DEV
(obj->is_shared, "Object is not shared: %!+O", obj);
+ BT_ASSERT_PRE
_DEV
(bt_object_get_ref_count(obj) > 0,
"Decrementing a reference count set to 0: %!+O", ptr);
#endif
"Decrementing a reference count set to 0: %!+O", ptr);
#endif
- bt_object_put_no_null_check(obj);
+ bt_object_put_
ref_
no_null_check(obj);
}
#define BT_OBJECT_PUT_REF_AND_RESET(_var) \
}
#define BT_OBJECT_PUT_REF_AND_RESET(_var) \
This page took
0.039832 seconds
and
4
git commands to generate.