mempool.h revision 80d3b05559a9024b8352d52419a1b1c0aeca654e
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen/* #define POOL_CHECK_LEAKS */
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen/* Memory allocated and reallocated (the new data in it) in pools is always
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen zeroed, it will cost only a few CPU cycles and may well save some debug
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen /* reallocate the `mem' to be exactly `size' */
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen void *(*realloc)(Pool pool, void *mem, size_t size);
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen /* Frees all the memory in pool. NOTE: system_pool doesn't support
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen this and crashes if it's used */
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen/* system_pool uses calloc() + realloc() + free() */
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen/* memory allocated from data_stack is valid only until next t_pop() call. */
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen/* Create a new alloc-only pool. Note that `size' specifies the initial
66bcc2a2f65576211f2f55edbe61130b96287fcdTimo Sirainen malloc()ed block size, part of it is used internally. */
STMT_START { \
} STMT_END
#ifdef POOL_CHECK_LEAKS