ir: add BT_CTF_MOVE()
Adds semantics to ownership transfers of CTF IR objects.
This is something that is done often enough to justify the
existence of this macro:
struct bt_ctf_field_type *type;
struct bt_ctf_field_type *ret_type;
/* ... */
/* move ownership */
ret_type = type;
type = NULL;
/* ... */
/* put both (safe since type was set to NULL) */
bt_ctf_put(ret_type);
bt_ctf_put(type);
With BT_CTF_MOVE():
struct bt_ctf_field_type *type;
struct bt_ctf_field_type *ret_type;
/* ... */
/* move ownership */
BT_CTF_MOVE(ret_type, type);
/* ... */
/* put both (safe since ownership was moved) */
bt_ctf_put(ret_type);
bt_ctf_put(type);
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.025865 seconds and 5 git commands to generate.