Kore 3
Loading...
Searching...
No Matches
indexallocator.h
1#ifndef KORE_INDEX_ALLOCATOR_HEADER
2#define KORE_INDEX_ALLOCATOR_HEADER
3
4#include <stdint.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#define KORE_INDEX_ALLOCATOR_SIZE 1024 * 10
11
12typedef struct kore_index_allocator {
13 uint32_t indices[KORE_INDEX_ALLOCATOR_SIZE];
14 uint32_t next_indices_index;
15 uint32_t remaining;
17
18void kore_index_allocator_init(kore_index_allocator *allocator);
19
20uint32_t kore_index_allocator_allocate(kore_index_allocator *allocator);
21
22void kore_index_allocator_free(kore_index_allocator *allocator, uint32_t index);
23
24#ifdef __cplusplus
25}
26#endif
27
28#endif
Definition indexallocator.h:12