-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstatic_mem_pool.h
More file actions
34 lines (25 loc) · 961 Bytes
/
static_mem_pool.h
File metadata and controls
34 lines (25 loc) · 961 Bytes
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
32
33
34
#ifndef __static_mem_pool_h
#define __static_mem_pool_h
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
struct static_mem_pool {
size_t init_size;
void *chunks;
void *nomemcc;
void (*nomem)(void*cc);
void *allocator;
void *(*alloc)(void*,size_t);
void (*dealloc)(void*,void*);
};
struct static_mem_pool *static_mem_pool_init( struct static_mem_pool *p
, size_t init_size
, void *nomemcc
, void (*nomem)(void*)
, void *allocator
, void *(*alloc)(void*,size_t)
, void (dealloc)(void*,void*) );
void static_mem_pool_destroy(struct static_mem_pool*);
void *static_mem_pool_alloc(void *, size_t n);
void static_mem_pool_dealloc(void*,void*);
#endif