23 #ifndef INCL_UTIL_POOL_H
24 #define INCL_UTIL_POOL_H 1
33 # ifdef JABBERD2_EXPORTS
34 # define JABBERD2_API __declspec(dllexport)
36 # define JABBERD2_API __declspec(dllimport)
39 # define JABBERD2_API extern
45 #define POOL_NUM 40009
87 char name[8], zone[32];
93 # define pool_new() _pool_new(__FILE__,__LINE__)
94 # define pool_heap(i) _pool_new_heap(i,__FILE__,__LINE__)
96 # define pool_heap(i) _pool_new_heap(i,NULL,0)
97 # define pool_new() _pool_new(NULL,0)
void * pmalloc(pool_t p, int size)
pool_t _pool_new(const char *zone, int line)
make an empty pool
pfree - a linked list node which stores an allocation chunk, plus a callback
struct pool_struct _pool
pool - base node for a pool.
void pool_cleanup(pool_t p, pool_cleanup_t f, void *arg)
public cleanup utils, insert in a way that they are run FIFO, before mem frees
void * pmalloco(pool_t p, int size)
easy safety utility (for creating blank mem for structs, etc)
char * pstrdupx(pool_t p, const char *src, int len)
use given size
struct pool_struct * pool_t
struct pfree * cleanup_tail
pheap - singular allocation of memory
char * pstrdup(pool_t p, const char *src)
XXX efficient: move this to const char * and then loop throug the existing heaps to see if src is wit...
pool_t _pool_new_heap(int size, const char *zone, int line)
void * pmalloc_x(pool_t p, int size, char c)
pool - base node for a pool.
void(* pool_cleanup_t)(void *arg)
pool_cleanup_t - callback type which is associated with a pool entry; invoked when the pool entry is ...