#include <babeltrace/ctf-writer/resolve-internal.h>
#include <babeltrace/ctf-writer/stream-class.h>
#include <babeltrace/ctf-writer/utils-internal.h>
-#include <babeltrace/ref.h>
+#include <babeltrace/object.h>
#include <babeltrace/types.h>
#include <babeltrace/values.h>
#include <glib.h>
{
struct type_stack_frame *frame = data;
- BT_PUT(frame->type);
+ BT_OBJECT_PUT_REF_AND_RESET(frame->type);
g_free(frame);
}
BT_LOGV("Pushing field type on context's stack: "
"ft-addr=%p, stack-size-before=%u", type, stack->len);
- frame->type = bt_get(type);
+ frame->type = bt_object_get_ref(type);
g_ptr_array_add(stack, frame);
end:
bt_bool first_level_done = BT_FALSE;
/* Get our own reference */
- bt_get(type);
+ bt_object_get_ref(type);
/* Locate target */
while (cur_ptoken) {
}
/* Move child type to current type */
- bt_get(child_type);
- BT_MOVE(type, child_type);
+ bt_object_get_ref(child_type);
+ BT_OBJECT_MOVE_REF(type, child_type);
}
end:
- bt_put(type);
+ bt_object_put_ref(type);
return ret;
}
}
end:
- BT_PUT(tail_field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(tail_field_path);
return ret;
}
end:
if (ret) {
- BT_PUT(field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(field_path);
}
ptokens_destroy(ptokens);
/* Start with root type */
type = get_type_from_ctx(ctx, field_path->root);
- bt_get(type);
+ bt_object_get_ref(type);
if (!type) {
/* Error: root type is not available */
BT_LOGW("Root field type is not available: root-scope=%s",
}
/* Move child type to current type */
- bt_get(child_type);
- BT_MOVE(type, child_type);
+ bt_object_get_ref(child_type);
+ BT_OBJECT_MOVE_REF(type, child_type);
}
return type;
error:
- BT_PUT(type);
+ BT_OBJECT_PUT_REF_AND_RESET(type);
return type;
}
return field_path;
error:
- BT_PUT(field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(field_path);
return field_path;
}
}
end:
- BT_PUT(ctx_field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(ctx_field_path);
return ret;
}
g_string_free(target_field_path_pretty, TRUE);
}
- BT_PUT(target_field_path);
- BT_PUT(target_type);
+ BT_OBJECT_PUT_REF_AND_RESET(target_field_path);
+ BT_OBJECT_PUT_REF_AND_RESET(target_type);
return ret;
}