#include <stdbool.h>
#include <inttypes.h>
#include <babeltrace/assert-internal.h>
+#include <babeltrace/common-internal.h>
#include <stdlib.h>
#include <string.h>
muxer_upstream_notif_iter,
muxer_upstream_notif_iter->notif_iter,
muxer_upstream_notif_iter->notifs->length);
- bt_put(muxer_upstream_notif_iter->notif_iter);
+ bt_object_put_ref(muxer_upstream_notif_iter->notif_iter);
if (muxer_upstream_notif_iter->notifs) {
struct bt_notification *notif;
while ((notif = g_queue_pop_head(
muxer_upstream_notif_iter->notifs))) {
- bt_put(notif);
+ bt_object_put_ref(notif);
}
g_queue_free(muxer_upstream_notif_iter->notifs);
goto end;
}
- muxer_upstream_notif_iter->notif_iter = bt_get(notif_iter);
+ muxer_upstream_notif_iter->notif_iter = bt_object_get_ref(notif_iter);
muxer_upstream_notif_iter->notifs = g_queue_new();
if (!muxer_upstream_notif_iter->notifs) {
BT_LOGE_STR("Failed to allocate a GQueue.");
}
static
-struct bt_value *get_default_params(void)
+struct bt_private_value *get_default_params(void)
{
- struct bt_value *params;
+ struct bt_private_value *params;
int ret;
- params = bt_value_map_create();
+ params = bt_private_value_map_create();
if (!params) {
BT_LOGE_STR("Cannot create a map value object.");
goto error;
}
- ret = bt_value_map_insert_bool_entry(params,
+ ret = bt_private_value_map_insert_bool_entry(params,
ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME, false);
if (ret) {
BT_LOGE_STR("Cannot add boolean value to map value object.");
goto end;
error:
- BT_PUT(params);
+ BT_OBJECT_PUT_REF_AND_RESET(params);
end:
return params;
static
int configure_muxer_comp(struct muxer_comp *muxer_comp, struct bt_value *params)
{
- struct bt_value *default_params = NULL;
- struct bt_value *real_params = NULL;
+ struct bt_private_value *default_params = NULL;
+ struct bt_private_value *real_params = NULL;
struct bt_value *assume_absolute_clock_classes = NULL;
int ret = 0;
bt_bool bool_val;
goto error;
}
- real_params = bt_value_map_extend(default_params, params);
+ real_params = bt_value_map_extend(
+ bt_value_borrow_from_private(default_params), params);
if (!real_params) {
BT_LOGE("Cannot extend default parameters map value: "
"muxer-comp-addr=%p, def-params-addr=%p, "
goto error;
}
- assume_absolute_clock_classes = bt_value_map_borrow_entry_value(real_params,
+ assume_absolute_clock_classes = bt_value_map_borrow_entry_value(
+ bt_value_borrow_from_private(real_params),
ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME);
if (assume_absolute_clock_classes &&
!bt_value_is_bool(assume_absolute_clock_classes)) {
BT_LOGE("Expecting a boolean value for the `%s` parameter: "
"muxer-comp-addr=%p, value-type=%s",
ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME, muxer_comp,
- bt_value_type_string(
+ bt_common_value_type_string(
bt_value_get_type(assume_absolute_clock_classes)));
goto error;
}
ret = -1;
end:
- bt_put(default_params);
- bt_put(real_params);
+ bt_object_put_ref(default_params);
+ bt_object_put_ref(real_params);
return ret;
}
port, bt_port_get_name(port), priv_conn, notif_iter);
end:
- bt_put(priv_conn);
+ bt_object_put_ref(priv_conn);
return notif_iter;
}
* won't be considered again to find the youngest
* notification.
*/
- BT_PUT(muxer_upstream_notif_iter->notif_iter);
+ BT_OBJECT_PUT_REF_AND_RESET(muxer_upstream_notif_iter->notif_iter);
status = BT_NOTIFICATION_ITERATOR_STATUS_OK;
break;
default:
muxer_notif_iter_add_upstream_notif_iter(
muxer_notif_iter, upstream_notif_iter,
priv_port);
- BT_PUT(upstream_notif_iter);
+ BT_OBJECT_PUT_REF_AND_RESET(upstream_notif_iter);
if (!muxer_upstream_notif_iter) {
/*
* muxer_notif_iter_add_upstream_notif_iter()
}
remove_node:
- bt_put(upstream_notif_iter);
+ bt_object_put_ref(upstream_notif_iter);
muxer_notif_iter->newly_connected_priv_ports =
g_list_delete_link(
muxer_notif_iter->newly_connected_priv_ports,
BT_LOGD("Skipping input port: not connected: "
"muxer-comp-addr=%p, port-addr=%p, port-name\"%s\"",
muxer_comp, port, bt_port_get_name(port));
- bt_put(priv_port);
+ bt_object_put_ref(priv_port);
continue;
}
- bt_put(priv_port);
+ bt_object_put_ref(priv_port);
muxer_notif_iter->newly_connected_priv_ports =
g_list_append(
muxer_notif_iter->newly_connected_priv_ports,
end:
muxer_comp->initializing_muxer_notif_iter = false;
- bt_put(priv_comp);
+ bt_object_put_ref(priv_comp);
return status;
}
destroy_muxer_notif_iter(muxer_notif_iter);
}
- bt_put(priv_comp);
+ bt_object_put_ref(priv_comp);
}
BT_HIDDEN
bt_notification_iterator_status_string(status));
}
- bt_put(priv_comp);
+ bt_object_put_ref(priv_comp);
return status;
}