X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fref-internal.hpp;h=a02ae4cdc1229a627226e74991cebb49887b4820;hp=68b6efd1b8b6a8290a964fe0ee045cdd553b2508;hb=HEAD;hpb=e665dfbce25215d5ec77ff03a279c7163b337db1 diff --git a/include/lttng/ref-internal.hpp b/include/lttng/ref-internal.hpp index 68b6efd1b..8416d6bcf 100644 --- a/include/lttng/ref-internal.hpp +++ b/include/lttng/ref-internal.hpp @@ -1,6 +1,3 @@ -#ifndef LTTNG_REF_INTERNAL_H -#define LTTNG_REF_INTERNAL_H - /* * LTTng - Non thread-safe reference counting * @@ -10,6 +7,13 @@ * */ +#ifndef LTTNG_REF_INTERNAL_H +#define LTTNG_REF_INTERNAL_H + +#include + +#include + using lttng_release_func = void (*)(void *); struct lttng_ref { @@ -17,16 +21,14 @@ struct lttng_ref { lttng_release_func release; }; -static inline -void lttng_ref_init(struct lttng_ref *ref, lttng_release_func release) +static inline void lttng_ref_init(struct lttng_ref *ref, lttng_release_func release) { LTTNG_ASSERT(ref); ref->count = 1; ref->release = release; } -static inline -void lttng_ref_get(struct lttng_ref *ref) +static inline void lttng_ref_get(struct lttng_ref *ref) { LTTNG_ASSERT(ref); ref->count++; @@ -34,8 +36,7 @@ void lttng_ref_get(struct lttng_ref *ref) LTTNG_ASSERT(ref->count); } -static inline -void lttng_ref_put(struct lttng_ref *ref) +static inline void lttng_ref_put(struct lttng_ref *ref) { LTTNG_ASSERT(ref); /* Underflow check. */