*
*/
-#include <common/compat/directory-handle.h>
-#include <common/credentials.h>
-#include <common/defaults.h>
-#include <common/dynamic-array.h>
-#include <common/error.h>
-#include <common/fd-tracker/fd-tracker.h>
-#include <common/fd-tracker/utils.h>
-#include <common/fs-handle.h>
-#include <common/fs-handle-internal.h>
-#include <common/hashtable/hashtable.h>
-#include <common/hashtable/utils.h>
-#include <common/optional.h>
-#include <common/string-utils/format.h>
-#include <common/time.h>
-#include <common/trace-chunk-registry.h>
-#include <common/trace-chunk.h>
-#include <common/utils.h>
+#include <common/compat/directory-handle.hpp>
+#include <common/credentials.hpp>
+#include <common/defaults.hpp>
+#include <common/dynamic-array.hpp>
+#include <common/error.hpp>
+#include <common/fd-tracker/fd-tracker.hpp>
+#include <common/fd-tracker/utils.hpp>
+#include <common/fs-handle.hpp>
+#include <common/fs-handle-internal.hpp>
+#include <common/hashtable/hashtable.hpp>
+#include <common/hashtable/utils.hpp>
+#include <common/optional.hpp>
+#include <common/string-utils/format.hpp>
+#include <common/time.hpp>
+#include <common/trace-chunk-registry.hpp>
+#include <common/trace-chunk.hpp>
+#include <common/utils.hpp>
#include <lttng/constant.h>
#include <inttypes.h>
goto end;
}
- handle = (fs_handle_untracked *) zmalloc(sizeof(typeof(*handle)));
+ handle = zmalloc<fs_handle_untracked>();
if (!handle) {
PERROR("Failed to allocate untracked filesystem handle");
goto end;
goto error;
}
}
- new_name = (char *) zmalloc(GENERATED_CHUNK_NAME_LEN);
+ new_name = calloc<char>(GENERATED_CHUNK_NAME_LEN);
if (!new_name) {
ERR("Failed to allocate buffer for automatically-generated trace chunk name");
goto error;
{
struct lttng_trace_chunk *chunk = NULL;
- chunk = (lttng_trace_chunk *) zmalloc(sizeof(*chunk));
+ chunk = zmalloc<lttng_trace_chunk>();
if (!chunk) {
ERR("Failed to allocate trace chunk");
goto end;
{
struct lttng_trace_chunk_registry *registry;
- registry = (lttng_trace_chunk_registry *) zmalloc(sizeof(*registry));
+ registry = zmalloc<lttng_trace_chunk_registry>();
if (!registry) {
goto end;
}
struct lttng_trace_chunk *chunk, uint64_t session_id)
{
struct lttng_trace_chunk_registry_element *element =
- (lttng_trace_chunk_registry_element *) zmalloc(sizeof(*element));
+ zmalloc<lttng_trace_chunk_registry_element>();
if (!element) {
goto end;