#ifndef _UCW_POOLS_H
#define _UCW_POOLS_H
+#include "lib/defines.h"
#include <ucw/alloc.h>
#include <ucw/config.h>
#include <ucw/lib.h>
*
* Memory pools can be treated as <<trans:respools,resources>>, see <<trans:res_mempool()>>.
**/
+KR_EXPORT
void mp_init(struct mempool *pool, size_t chunk_size);
/**
*
* Memory pools can be treated as <<trans:respools,resources>>, see <<trans:res_mempool()>>.
**/
+KR_EXPORT
struct mempool *mp_new(size_t chunk_size);
/**
* Frees all the memory allocated by this mempool and,
* if created by @mp_new(), the @pool itself.
**/
+KR_EXPORT
void mp_delete(struct mempool *pool);
/**
* further allocation requests. Leaves the @pool alive,
* even if it was created with @mp_new().
**/
+KR_EXPORT
void mp_flush(struct mempool *pool);
/**
* `CPU_STRUCT_ALIGN` bytes and this condition remains true also
* after future reallocations.
**/
+KR_EXPORT
void *mp_alloc(struct mempool *pool, size_t size);
/**
/**
* printf() into a in-memory string, allocated on the memory pool.
**/
+KR_EXPORT
char *mp_printf(struct mempool *mp, const char *fmt, ...) FORMAT_CHECK(printf,2,3) LIKE_MALLOC;
/**
* Like @mp_printf(), but uses `va_list` for parameters.
* not called on an opened growing buffer. The old name will be preserved for backward
* compatibility for the time being.
**/
+KR_EXPORT
char *mp_printf_append(struct mempool *mp, char *ptr, const char *fmt, ...) FORMAT_CHECK(printf,3,4);
#define mp_append_printf mp_printf_append
/**