aboutsummaryrefslogtreecommitdiff
path: root/include/mempool.h
blob: c946c3173928844668ae7e70f9fbcb9a7eb860c8 (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
31
/* 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"
#include "sqfs/predef.h"

typedef struct mem_pool_t mem_pool_t;

#ifdef __cplusplus
extern "C" {
#endif

SQFS_INTERNAL mem_pool_t *mem_pool_create(size_t obj_size);

SQFS_INTERNAL void mem_pool_destroy(mem_pool_t *mem);

SQFS_INTERNAL void *mem_pool_allocate(mem_pool_t *mem);

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

#ifdef __cplusplus
}
#endif

#endif /* MEMPOOL_H */