SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / src / common / index-allocator.h
CommitLineData
2463b787
JR
1/*
2 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef _COMMON_INDEX_ALLOCATOR_H
9#define _COMMON_INDEX_ALLOCATOR_H
10
11#include <inttypes.h>
12
13struct lttng_index_allocator;
14
15enum lttng_index_allocator_status {
16 LTTNG_INDEX_ALLOCATOR_STATUS_OK,
17 LTTNG_INDEX_ALLOCATOR_STATUS_EMPTY,
18 LTTNG_INDEX_ALLOCATOR_STATUS_ERROR,
19};
20
21struct lttng_index_allocator *lttng_index_allocator_create(
22 uint64_t index_count);
23
24uint64_t lttng_index_allocator_get_index_count(
25 struct lttng_index_allocator *allocator);
26
27enum lttng_index_allocator_status lttng_index_allocator_alloc(
28 struct lttng_index_allocator *allocator,
29 uint64_t *index);
30
31enum lttng_index_allocator_status lttng_index_allocator_release(
32 struct lttng_index_allocator *allocator, uint64_t index);
33
34void lttng_index_allocator_destroy(struct lttng_index_allocator *allocator);
35
36#endif /* _COMMON_INDEX_ALLOCATOR_H */
This page took 0.035449 seconds and 5 git commands to generate.