projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: update and simplify the `bt_object` API
[babeltrace.git]
/
lib
/
values.c
diff --git
a/lib/values.c
b/lib/values.c
index 1d5adfa98b7918bd374fecdfd2c95c17fea9dc6b..7514d52a0a4740c21bd67883ab9d51cad352d409 100644
(file)
--- a/
lib/values.c
+++ b/
lib/values.c
@@
-71,14
+71,20
@@
struct bt_value {
bt_bool frozen;
};
bt_bool frozen;
};
+static
+void bt_value_null_instance_release_func(struct bt_object *obj)
+{
+ BT_LOGW("Releasing the null value singleton: addr=%p", obj);
+}
+
static
struct bt_value bt_value_null_instance = {
.base = {
static
struct bt_value bt_value_null_instance = {
.base = {
- .
ref_count = {
-
.
count = 1,
-
.release = NULL
,
-
}
,
- .
release
= NULL,
+ .
is_shared = true,
+
.ref_
count = 1,
+
.release_func = bt_value_null_instance_release_func
,
+
.spec_release_func = NULL
,
+ .
parent_is_owner_listener_func
= NULL,
.parent = NULL,
},
.type = BT_VALUE_TYPE_NULL,
.parent = NULL,
},
.type = BT_VALUE_TYPE_NULL,
@@
-571,12
+577,12
@@
enum bt_value_type bt_value_get_type(const struct bt_value *object)
static
struct bt_value bt_value_create_base(enum bt_value_type type)
{
static
struct bt_value bt_value_create_base(enum bt_value_type type)
{
- struct bt_value
bas
e;
+ struct bt_value
valu
e;
-
bas
e.type = type;
-
bas
e.frozen = BT_FALSE;
- bt_object_init
(&
base, bt_value_destroy);
- return
bas
e;
+
valu
e.type = type;
+
valu
e.frozen = BT_FALSE;
+ bt_object_init
_shared(&value.
base, bt_value_destroy);
+ return
valu
e;
}
struct bt_value *bt_value_bool_create_init(bt_bool val)
}
struct bt_value *bt_value_bool_create_init(bt_bool val)
This page took
0.029604 seconds
and
4
git commands to generate.