Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / lib / lttng-ctl / tracker.cpp
index b7fc1f78a0f794976022bb29ab1c37b1fef3689e..4930e94ce57610469f9fcc9558425556b31d3cfd 100644 (file)
@@ -5,14 +5,14 @@
  *
  */
 
-#include <type_traits>
+#include <lttng/domain.h>
+#include <lttng/lttng-error.h>
 
-#include "lttng-ctl-helper.h"
-#include "lttng/domain.h"
-#include "lttng/lttng-error.h"
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/tracker.h>
+#include "lttng-ctl-helper.hpp"
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/tracker.hpp>
 #include <lttng/tracker.h>
+#include <type_traits>
 
 struct lttng_process_attr_tracker_handle {
        char *session_name;
@@ -53,7 +53,7 @@ enum lttng_error_code lttng_session_get_tracker_handle(const char *session_name,
                goto error;
        }
 
-       handle = (lttng_process_attr_tracker_handle *) zmalloc(sizeof(*handle));
+       handle = zmalloc<lttng_process_attr_tracker_handle>();
        if (!handle) {
                ret_code = LTTNG_ERR_NOMEM;
                goto error;
@@ -779,7 +779,7 @@ int lttng_list_tracker_pids(struct lttng_handle *handle,
                goto end;
        }
 
-       pid_array = (int32_t *) zmalloc(pid_count * sizeof(int32_t));
+       pid_array = calloc<int32_t>(pid_count);
        if (!pid_array) {
                ret_code = LTTNG_ERR_NOMEM;
                goto end;
This page took 0.025493 seconds and 4 git commands to generate.