summaryrefslogtreecommitdiff
path: root/accel-pppd/triton/mempool.h
blob: 53eebfb7a2a94debacc535b21299a734412935d3 (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
#ifndef __TRITON_MEMPOOL_H
#define __TRITON_MEMPOOL_H

#include <stdint.h>

struct mempool_stat_t
{
	uint32_t allocated;	
	uint32_t available;
};

typedef void * mempool_t;
mempool_t *mempool_create(int size);
mempool_t *mempool_create2(int size);
struct mempool_stat_t mempool_get_stat(void);

#ifdef MEMDEBUG
void *md_mempool_alloc(mempool_t*, const char *fname, int line);
#define mempool_alloc(pool) md_mempool_alloc(pool, __FILE__, __LINE__)
#define mempool_free(ptr) md_free(ptr, __FILE__, __LINE__)
#else
void *mempool_alloc(mempool_t*);
void mempool_free(void*);
#endif

#endif