aboutsummaryrefslogtreecommitdiff
path: root/include/mempool.h
blob: 6d3990e620c62751ef1e5ec19bcd850f1185da3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* SPDX-License-Identifier: LGPL-3.0-or-later */
/*
 * mempool.h
 *
 * Copyright (C) 2021 David Oberhollenzer <goliath@infraroot.at>
 */
#ifndef MEMPOOL_H
#define MEMPOOL_H

#include "compat.h"

typedef struct mem_pool_t mem_pool_t;

#ifdef __cplusplus
extern "C" {
#endif

mem_pool_t *mem_pool_create(size_t obj_size);

void mem_pool_destroy(mem_pool_t *mem);

void *mem_pool_allocate(mem_pool_t *mem);

void mem_pool_free(mem_pool_t *mem, void *ptr);

#ifdef __cplusplus
}
#endif

#endif /* MEMPOOL_H */