Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / lib / lttng-ctl / channel.cpp
index f464e7000573ac0381b366b51a50b660845f61c5..3f3c53996ff2f461dda6b0d0030ee5f5dad89781 100644 (file)
@@ -5,20 +5,20 @@
  *
  */
 
-#include <lttng/notification/notification-internal.h>
-#include <lttng/notification/channel-internal.h>
-#include <lttng/condition/condition-internal.h>
+#include <lttng/notification/notification-internal.hpp>
+#include <lttng/notification/channel-internal.hpp>
+#include <lttng/condition/condition-internal.hpp>
 #include <lttng/endpoint.h>
-#include <common/defaults.h>
-#include <common/error.h>
-#include <common/dynamic-buffer.h>
-#include <common/utils.h>
-#include <common/defaults.h>
-#include <common/payload.h>
-#include <common/payload-view.h>
-#include <common/unix.h>
-#include "lttng-ctl-helper.h"
-#include <common/compat/poll.h>
+#include <common/defaults.hpp>
+#include <common/error.hpp>
+#include <common/dynamic-buffer.hpp>
+#include <common/utils.hpp>
+#include <common/defaults.hpp>
+#include <common/payload.hpp>
+#include <common/payload-view.hpp>
+#include <common/unix.hpp>
+#include "lttng-ctl-helper.hpp"
+#include <common/compat/poll.hpp>
 
 static
 int handshake(struct lttng_notification_channel *channel);
@@ -143,12 +143,12 @@ struct lttng_notification_channel *lttng_notification_channel_create(
                goto end;
        }
 
-       sock_path = (char *) zmalloc(LTTNG_PATH_MAX);
+       sock_path = calloc<char>(LTTNG_PATH_MAX);
        if (!sock_path) {
                goto end;
        }
 
-       channel = (lttng_notification_channel *) zmalloc(sizeof(struct lttng_notification_channel));
+       channel = zmalloc<lttng_notification_channel>();
        if (!channel) {
                goto end;
        }
@@ -343,7 +343,7 @@ int enqueue_dropped_notification(
                goto end;
        }
 
-       pending_notification = (struct pending_notification *) zmalloc(sizeof(*pending_notification));
+       pending_notification = zmalloc<struct pending_notification>();
        if (!pending_notification) {
                ret = -1;
                goto end;
@@ -371,7 +371,7 @@ int enqueue_notification_from_current_message(
                goto end;
        }
 
-       pending_notification = (struct pending_notification *) zmalloc(sizeof(*pending_notification));
+       pending_notification = zmalloc<struct pending_notification>();
        if (!pending_notification) {
                ret = -1;
                goto error;
This page took 0.025225 seconds and 4 git commands to generate.