X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmempool.h;h=6f6a7ffe1387a161428d583e69d560656172d014;hb=751d6c55d37bf6485427080e9884ab22291b66f0;hp=7290c256f6865d61f0458e882ef04ad08fc5f5b5;hpb=70398f11c811ae9acad63c31eec3611b2b7322d9;p=libucw.git diff --git a/lib/mempool.h b/lib/mempool.h index 7290c256..6f6a7ffe 100644 --- a/lib/mempool.h +++ b/lib/mempool.h @@ -29,7 +29,7 @@ void *mp_alloc_zero(struct mempool *, uns); static inline void *mp_alloc_fast(struct mempool *p, uns l) { - byte *f = (void *) (((uns) p->free + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1)); + byte *f = (void *) (((addr_int_t) p->free + POOL_ALIGN - 1) & ~(addr_int_t)(POOL_ALIGN - 1)); byte *ee = f + l; if (ee > p->last) return mp_alloc(p, l); @@ -63,16 +63,18 @@ mp_end_string(struct mempool *p, void *stop) /* mempool-str.c */ char *mp_strdup(struct mempool *, char *); +void *mp_memdup(struct mempool *, void *, uns); char *mp_multicat(struct mempool *, ...); static inline char * mp_strcat(struct mempool *mp, char *x, char *y) { return mp_multicat(mp, x, y, NULL); } +char *mp_strjoin(struct mempool *p, char **a, uns n, uns sep); /* mempool-fmt.c */ -char *mp_printf(struct mempool *p, char *fmt, ...); +char *mp_printf(struct mempool *p, char *fmt, ...) FORMAT_CHECK(printf,2,3); char *mp_vprintf(struct mempool *p, char *fmt, va_list args); #endif