diff options
Diffstat (limited to 'accel-pppd/triton/mempool.h')
-rw-r--r-- | accel-pppd/triton/mempool.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/accel-pppd/triton/mempool.h b/accel-pppd/triton/mempool.h new file mode 100644 index 00000000..bdb3e712 --- /dev/null +++ b/accel-pppd/triton/mempool.h @@ -0,0 +1,26 @@ +#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); +void mempool_free(void*); +struct mempool_stat_t mempool_get_stat(void); + +#ifdef MEMDEBUG +void *mempool_alloc_md(mempool_t*, const char *fname, int line); +#define mempool_alloc(pool) mempool_alloc_md(pool, __FILE__, __LINE__) +#else +void *mempool_alloc(mempool_t*); +#endif + +#endif + |