Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / common / kernel-probe.cpp
index a05b451c38dc406a68b4c5631841aaf649db96c8..172527f9a4f33d4cb6cb66db1f10edec9bbf2879 100644 (file)
@@ -6,16 +6,16 @@
  */
 
 #include "lttng/lttng-error.h"
-#include <common/error.h>
-#include <common/hashtable/hashtable.h>
-#include <common/hashtable/utils.h>
-#include <common/macros.h>
-#include <common/mi-lttng.h>
-#include <common/payload-view.h>
-#include <common/payload.h>
+#include <common/error.hpp>
+#include <common/hashtable/hashtable.hpp>
+#include <common/hashtable/utils.hpp>
+#include <common/macros.hpp>
+#include <common/mi-lttng.hpp>
+#include <common/payload-view.hpp>
+#include <common/payload.hpp>
 #include <fcntl.h>
 #include <lttng/constant.h>
-#include <lttng/kernel-probe-internal.h>
+#include <lttng/kernel-probe-internal.hpp>
 #include <lttng/kernel-probe.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -117,7 +117,7 @@ lttng_kernel_probe_location_address_create(uint64_t address)
        struct lttng_kernel_probe_location *ret = NULL;
        struct lttng_kernel_probe_location_address *location;
 
-       location = (lttng_kernel_probe_location_address *) zmalloc(sizeof(*location));
+       location = zmalloc<lttng_kernel_probe_location_address>();
        if (!location) {
                PERROR("Error allocating userspace probe location.");
                goto end;
@@ -154,7 +154,7 @@ lttng_kernel_probe_location_symbol_create(const char *symbol_name,
                goto error;
        }
 
-       location = (lttng_kernel_probe_location_symbol *) zmalloc(sizeof(*location));
+       location = zmalloc<lttng_kernel_probe_location_symbol>();
        if (!location) {
                PERROR("Failed to allocate kernel symbol probe location");
                goto error;
This page took 0.024986 seconds and 4 git commands to generate.