Unify process_alloc() and process_realloc() with PROCESS_ALLOC_MODE_REALLOC bit
[moveable_pool.git] / block_pool.h
1 #ifndef _BLOCK_POOL_H
2 #define _BLOCK_POOL_H 1
3
4 #include <stdbool.h>
5 #include <stdint.h>
6
7 struct block_pool {
8   int n_blocks;
9   int n_bitmap;
10   uint8_t *bitmap;
11   int next;
12   int avail;
13 };
14
15 void block_pool_init(struct block_pool *block_pool, int n_blocks);
16 bool block_pool_alloc(struct block_pool *block_pool, int *blocks, int size);
17 void block_pool_free(struct block_pool *block_pool, int *blocks, int size);
18
19 #endif