From: Martin Mares Date: Thu, 27 Feb 2003 17:35:19 +0000 (+0000) Subject: Added routines for easy dynamic creation of strings. X-Git-Tag: holmes-import~1277 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b9e396031daf6fd8d75d9050923941d545212dd1;p=libucw.git Added routines for easy dynamic creation of strings. --- diff --git a/lib/pools.h b/lib/pools.h index aef1e63e..a055ef26 100644 --- a/lib/pools.h +++ b/lib/pools.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Memory Pools * - * (c) 1997--2001 Martin Mares + * (c) 1997--2003 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -47,4 +47,17 @@ static inline void *mp_alloc_fast_noalign(struct mempool *p, uns l) return f; } +static inline void * +mp_start_string(struct mempool *p, uns l) +{ + ASSERT(l <= p->chunk_size); + return mp_alloc(p, l); +} + +static inline void +mp_end_string(struct mempool *p, void *stop) +{ + p->free = stop; +} + #endif