Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / common / health / health.cpp
index 8a07e642607cb6cb401a57c845043ca63870f97e..8181eab931c07aa0c131c8157ce85a6584f8d11c 100644 (file)
 #include <stdlib.h>
 #include <time.h>
 
-#include <common/defaults.h>
-#include <common/error.h>
-#include <common/macros.h>
-#include <common/sessiond-comm/inet.h>
+#include <common/defaults.hpp>
+#include <common/error.hpp>
+#include <common/macros.hpp>
+#include <common/sessiond-comm/inet.hpp>
 
-#include <lttng/health-internal.h>
+#include <lttng/health-internal.hpp>
 
 /*
  * An application-specific error state for unregistered thread keeps
@@ -67,11 +67,11 @@ struct health_app *health_app_create(int nr_types)
 {
        struct health_app *ha;
 
-       ha = (health_app *) zmalloc(sizeof(*ha));
+       ha = zmalloc<health_app>();
        if (!ha) {
                return NULL;
        }
-       ha->flags = (health_flags *) zmalloc(sizeof(*ha->flags) * nr_types);
+       ha->flags = calloc<health_flags>(nr_types);
        if (!ha->flags) {
                goto error_flags;
        }
This page took 0.024978 seconds and 4 git commands to generate.