00001 #include <stddef.h>
00002
00003 #define POOL_CLEAR (1<<0)
00004 #define POOL_QALIGN (1<<1)
00005 #define POOL_INTERN (1<<2)
00006 #define POOL_APPEND (1<<3)
00007
00008 typedef void *alloc_pool_t;
00009
00010 alloc_pool_t pool_create(size_t size, size_t quantum, void (*bomb)(char *), int flags);
00011 void pool_destroy(alloc_pool_t pool);
00012 void *pool_alloc(alloc_pool_t pool, size_t size, char *bomb);
00013 void pool_free(alloc_pool_t pool, size_t size, void *addr);
00014
00015 #define pool_talloc(pool, type, count, bomb) \
00016 ((type *)pool_alloc(pool, sizeof(type) * count, bomb))
00017
00018 #define pool_tfree(pool, type, count, addr) \
00019 (pool_free(pool, sizeof(type) * count, addr))
00020