X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Factions%2Frate-policy.cpp;h=c9c7a05197c2cbea1d8f8be4c8d30c8f2f07b1a1;hb=c08136a3fab16fd3f620c8bcd93f25ea68382d00;hp=d0834dd732e14c2f203897b7dc743dbb137307bf;hpb=a6bc4ca9d659caf016ef932fcd944029737ac57c;p=lttng-tools.git diff --git a/src/common/actions/rate-policy.cpp b/src/common/actions/rate-policy.cpp index d0834dd73..c9c7a0519 100644 --- a/src/common/actions/rate-policy.cpp +++ b/src/common/actions/rate-policy.cpp @@ -5,15 +5,15 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include #include @@ -48,6 +48,7 @@ struct lttng_rate_policy { rate_policy_mi_serialize_cb mi_serialize; }; +namespace { struct lttng_rate_policy_every_n { struct lttng_rate_policy parent; uint64_t interval; @@ -70,6 +71,7 @@ struct lttng_rate_policy_once_after_n_comm { struct lttng_rate_policy_every_n_comm { uint64_t interval; } LTTNG_PACKED; +} /* namespace */ /* Forward declaration. */ static void lttng_rate_policy_init(struct lttng_rate_policy *rate_policy, @@ -487,7 +489,7 @@ struct lttng_rate_policy *lttng_rate_policy_every_n_create(uint64_t interval) goto end; } - policy = (lttng_rate_policy_every_n *) zmalloc(sizeof(struct lttng_rate_policy_every_n)); + policy = zmalloc(); if (!policy) { goto end; } @@ -702,7 +704,7 @@ struct lttng_rate_policy *lttng_rate_policy_once_after_n_create( goto end; } - policy = (lttng_rate_policy_once_after_n *) zmalloc(sizeof(struct lttng_rate_policy_once_after_n)); + policy = zmalloc(); if (!policy) { goto end; }