From b9e396031daf6fd8d75d9050923941d545212dd1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 27 Feb 2003 17:35:19 +0000 Subject: [PATCH] Added routines for easy dynamic creation of strings. --- lib/pools.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 -- 2.39.2