xmempool 1.1.2
A memory pool implemented by C.
Loading...
Searching...
No Matches
xmempool.h
Go to the documentation of this file.
1#ifndef XMEMPOOL_H_
2#define XMEMPOOL_H_
3
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#ifdef _MSC_VER
18#include "__stdint.h"
19#else
20#include <stdint.h>
21#endif
22
26#define XMEMPOOL_VERSION_MAJOR 1
27
31#define XMEMPOOL_VERSION_MINOR 1
32
36#define XMEMPOOL_VERSION_PATCH 2
37
41#define XMEMPOOL_VERSION_STRING "1.1.2"
42
49typedef char* xmem_pool_handle;
50
61extern xmem_pool_handle xmem_create_pool(uint32_t block_size);
62
73
84extern char* xmem_alloc(xmem_pool_handle handle);
85
98extern int xmem_free(xmem_pool_handle handle, char* pointer);
99
109
117extern void xmem_clean_up();
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif // XMEMPOOL_H_
void xmem_clean_up()
Clean up global resources used by xmempool.
char * xmem_pool_handle
Handle type for memory pools.
Definition xmempool.h:49
void xmem_print_info(xmem_pool_handle pool)
Print information about the memory pool.
xmem_pool_handle xmem_create_pool(uint32_t block_size)
Create a new memory pool.
char * xmem_alloc(xmem_pool_handle handle)
Allocate a block from the memory pool.
int xmem_free(xmem_pool_handle handle, char *pointer)
Free a block back to the memory pool.
void xmem_destroy_pool(xmem_pool_handle pool)
Destroy a memory pool and free all associated resources.