Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / common / index / index.cpp
index 48d30e428253518412c276c89012d0cc71c1e2f0..de66ac4bdd3088427fccd5d9a00f0adc5a4a4da9 100644 (file)
 #include <fcntl.h>
 
 #include <lttng/constant.h>
-#include <common/common.h>
-#include <common/defaults.h>
-#include <common/compat/endian.h>
-#include <common/utils.h>
+#include <common/common.hpp>
+#include <common/defaults.hpp>
+#include <common/compat/endian.hpp>
+#include <common/utils.hpp>
 
-#include "index.h"
+#include "index.hpp"
 
 #define WRITE_FILE_FLAGS       (O_WRONLY | O_CREAT | O_TRUNC)
 #define READ_ONLY_FILE_FLAGS   O_RDONLY
@@ -45,7 +45,7 @@ static enum lttng_trace_chunk_status _lttng_index_file_create_from_trace_chunk(
 
        LTTNG_ASSERT(acquired_reference);
 
-       index_file = (lttng_index_file *) zmalloc(sizeof(*index_file));
+       index_file = zmalloc<lttng_index_file>();
        if (!index_file) {
                PERROR("Failed to allocate lttng_index_file");
                chunk_status = LTTNG_TRACE_CHUNK_STATUS_ERROR;
This page took 0.024783 seconds and 4 git commands to generate.