X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Findex-allocator.h;h=ee7c2ec758dd5dd707780b9a42ae5d3c0d4fab6c;hb=4878de5c7deb512bbdac4fdfc498907efa06fb7c;hp=3da733e9ef03db82c4f08a33345de07dbef0df8a;hpb=246611b0dffa58fbc0e2329ddf6f9dc9d9eff7ce;p=lttng-tools.git diff --git a/src/common/index-allocator.h b/src/common/index-allocator.h index 3da733e9e..ee7c2ec75 100644 --- a/src/common/index-allocator.h +++ b/src/common/index-allocator.h @@ -9,6 +9,7 @@ #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. */ +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); /* * 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); @@ -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. */ +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); #endif /* _COMMON_INDEX_ALLOCATOR_H */