common: replace container_of with a C++ safe implementation
[lttng-tools.git] / src / common / actions / notify.cpp
index 8ee51c31617a6370b776a5415230056bfa9f2901..d58dcbe3621b54e1dd139e91a90b743257637a34 100644 (file)
@@ -21,7 +21,7 @@ static struct lttng_action_notify *action_notify_from_action(
 {
        LTTNG_ASSERT(action);
 
-       return container_of(action, struct lttng_action_notify, parent);
+       return lttng::utils::container_of(action, &lttng_action_notify::parent);
 }
 
 static const struct lttng_action_notify *action_notify_from_action_const(
@@ -29,7 +29,7 @@ static const struct lttng_action_notify *action_notify_from_action_const(
 {
        LTTNG_ASSERT(action);
 
-       return container_of(action, struct lttng_action_notify, parent);
+       return lttng::utils::container_of(action, &lttng_action_notify::parent);
 }
 
 static
@@ -132,7 +132,7 @@ struct lttng_action *lttng_action_notify_create(void)
        struct lttng_action_notify *notify = NULL;
        struct lttng_action *action = NULL;
 
-       notify = (lttng_action_notify *) zmalloc(sizeof(struct lttng_action_notify));
+       notify = zmalloc<lttng_action_notify>();
        if (!notify) {
                goto end;
        }
This page took 0.027494 seconds and 4 git commands to generate.