X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Findex-allocator.h;h=7ab067ba17a97d8d0318b22eafaf415b07015604;hb=a79b00288bf0b04818aed5ca5cfd548f0f3b55c2;hp=3da733e9ef03db82c4f08a33345de07dbef0df8a;hpb=364369ca9a41e7e67de24f460f12c49cea450ed4;p=lttng-tools.git diff --git a/src/common/index-allocator.h b/src/common/index-allocator.h index 3da733e9e..7ab067ba1 100644 --- a/src/common/index-allocator.h +++ b/src/common/index-allocator.h @@ -8,6 +8,7 @@ #ifndef _COMMON_INDEX_ALLOCATOR_H #define _COMMON_INDEX_ALLOCATOR_H +#include #include struct lttng_index_allocator; @@ -21,18 +22,21 @@ enum lttng_index_allocator_status { /* * Create an index allocator of `index_count` slots. */ +LTTNG_HIDDEN struct lttng_index_allocator *lttng_index_allocator_create( uint64_t index_count); /* * Get the number of indexes currently in use. */ +LTTNG_HIDDEN uint64_t lttng_index_allocator_get_index_count( struct lttng_index_allocator *allocator); /* * Allocate (i.e. reserve) a slot. */ +LTTNG_HIDDEN enum lttng_index_allocator_status lttng_index_allocator_alloc( struct lttng_index_allocator *allocator, uint64_t *index); @@ -41,12 +45,14 @@ enum lttng_index_allocator_status lttng_index_allocator_alloc( * Release a slot by index. The slot will be re-used by the index allocator * in future 'alloc' calls. */ +LTTNG_HIDDEN enum lttng_index_allocator_status lttng_index_allocator_release( struct lttng_index_allocator *allocator, uint64_t index); /* * Destroy an index allocator. */ +LTTNG_HIDDEN void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator); #endif /* _COMMON_INDEX_ALLOCATOR_H */