common: remove `BT_MOVE_REF`
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 9 May 2024 16:03:31 +0000 (12:03 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 9 May 2024 18:47:25 +0000 (14:47 -0400)
Change-Id: I458cbcdf8829a99f3290e0d76db2e13c23b1776f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12537
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/common/macros.h

index 8120515c63fe5bbcd81672f8c7b4cf1df89d9ce8..0f2bc8fb116eda78ac663d748ced56368430d4a6 100644 (file)
@@ -45,29 +45,6 @@ extern "C" {
 #define BT_IF_DEV_MODE(txt)
 #endif
 
-/*
- * Yield `ref`'s value while setting `ref` to NULL.
- *
- * This can be used to give a strong reference to a callee:
- *
- *   add_foo_to_list(list, BT_MOVE_REF(foo));
- *
- * or in a simple assignment:
- *
- *   my_struct->foo = BT_MOVE_REF(foo);
- *
- * When moving a reference in a function call, the reference is given to the
- * callee even if that function call fails, so make sure the called function
- * is written accordingly.
- */
-
-#define BT_MOVE_REF(ref)               \
-       ({                              \
-               __typeof__(ref) _ref = ref;     \
-               ref = NULL;             \
-               _ref;                   \
-       })
-
 /* Wrapper for g_array_index that adds bound checking.  */
 #define bt_g_array_index(a, t, i)              \
        g_array_index((a), t, ({ BT_ASSERT_DBG((i) < (a)->len); (i); }))
This page took 0.026093 seconds and 4 git commands to generate.