X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Findex-allocator.hpp;h=2fa34041263d50f8d971ff15c7bcc43e3020a185;hb=28f23191dcbf047429d51950a337a57d7a3f866a;hp=ee7c2ec758dd5dd707780b9a42ae5d3c0d4fab6c;hpb=f250b40e2179eccdb83766bf4abef5a35036c47b;p=lttng-tools.git diff --git a/src/common/index-allocator.hpp b/src/common/index-allocator.hpp index ee7c2ec75..2fa340412 100644 --- a/src/common/index-allocator.hpp +++ b/src/common/index-allocator.hpp @@ -8,9 +8,10 @@ #ifndef _COMMON_INDEX_ALLOCATOR_H #define _COMMON_INDEX_ALLOCATOR_H -#include #include +#include + struct lttng_index_allocator; enum lttng_index_allocator_status { @@ -22,37 +23,31 @@ enum lttng_index_allocator_status { /* * Create an index allocator of `index_count` slots. */ -extern "C" LTTNG_EXPORT -struct lttng_index_allocator *lttng_index_allocator_create( - uint64_t index_count); +extern "C" LTTNG_EXPORT struct lttng_index_allocator * +lttng_index_allocator_create(uint64_t index_count); /* * Get the number of indexes currently in use. */ -extern "C" LTTNG_EXPORT -uint64_t lttng_index_allocator_get_index_count( - struct lttng_index_allocator *allocator); +extern "C" LTTNG_EXPORT uint64_t +lttng_index_allocator_get_index_count(struct lttng_index_allocator *allocator); /* * Allocate (i.e. reserve) a slot. */ -extern "C" LTTNG_EXPORT -enum lttng_index_allocator_status lttng_index_allocator_alloc( - struct lttng_index_allocator *allocator, - uint64_t *index); +extern "C" LTTNG_EXPORT enum lttng_index_allocator_status +lttng_index_allocator_alloc(struct lttng_index_allocator *allocator, uint64_t *index); /* * Release a slot by index. The slot will be re-used by the index allocator * in future 'alloc' calls. */ -extern "C" LTTNG_EXPORT -enum lttng_index_allocator_status lttng_index_allocator_release( - struct lttng_index_allocator *allocator, uint64_t index); +extern "C" LTTNG_EXPORT enum lttng_index_allocator_status +lttng_index_allocator_release(struct lttng_index_allocator *allocator, uint64_t index); /* * Destroy an index allocator. */ -extern "C" LTTNG_EXPORT -void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator); +extern "C" LTTNG_EXPORT void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator); #endif /* _COMMON_INDEX_ALLOCATOR_H */