X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fmempool.h;h=350054e3fc481d0eb8a8879daabb1c1d021f7178;hb=4d8858ba28597c458bef262399b553e5da89442a;hp=e0d2b43cc061b0cd50d09a81910f7bf872101b6e;hpb=a50ec82cb8c6fe468b8e819c0426f5c8b5268f78;p=libucw.git diff --git a/ucw/mempool.h b/ucw/mempool.h index e0d2b43c..350054e3 100644 --- a/ucw/mempool.h +++ b/ucw/mempool.h @@ -54,6 +54,8 @@ struct mempool_stats { /** Mempool statistics. See @mp_stats(). **/ * @chunk_size must be in the interval `[1, UINT_MAX / 2]`. * It will allocate memory by this large chunks and take * memory to satisfy requests from them. + * + * Memory pools can be treated as <>, see <>. **/ void mp_init(struct mempool *pool, uns chunk_size); @@ -62,6 +64,8 @@ void mp_init(struct mempool *pool, uns chunk_size); * See @mp_init() for @chunk_size limitations. * * The new mempool structure is allocated on the new mempool. + * + * Memory pools can be treated as <>, see <>. **/ struct mempool *mp_new(uns chunk_size); @@ -406,6 +410,11 @@ static inline char *LIKE_MALLOC mp_strcat(struct mempool *mp, const char *x, con * tells how many there is of them. **/ char *mp_strjoin(struct mempool *p, char **a, uns n, uns sep) LIKE_MALLOC; +/** + * Convert memory block to a string. Makes a copy of the given memory block + * in the mempool @p, adding an extra terminating zero byte at the end. + **/ +char *mp_str_from_mem(struct mempool *p, const void *mem, uns len) LIKE_MALLOC; /***